Re: alignment of pasted text with line breaks is altered in table

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Maybe your basic table cell style is set to right-justified, and all
the cells that look otherwise have special formatting applied on top
of that. If you select the text in one of the properly formatted cells
and type Ctrl-Space (or Ctrl-Shift-Z), does the same thing happen? (If
so, type Ctrl-Z to Undo it.)

In that case, your fix would be to alter the style being used for the
cells.

On Feb 22, 8:41 am, wildetudor <wildetu...@xxxxxxxxxxxxxxxxxxxxxxxxx>
wrote:
It doesn't matter where the pasted text originates from. Just assume for
simplicity that it comes from a txt file and that it has line breaks in it (I
actually tried this, and got the same results). If I paste the text in a
table cell which is aligned left, the text becomes aligned right (or
centered). If I just paste it outside of a table, the correct alignment is
set.

Oh, and Paste Special|Unformatted Text seems to have the same effect as a
regular Paste, in this case.



"Graham Mayor" wrote:
The whole point of PDF is that it is a graphical format for viewing
documents. You cannot, as you are undoubtedly aware, simply recreate the
document from which the PDF was prepared. The first thing to do when pasting
PDF material is to use edit > paste special > unformatted text (or use the
following macro)

Sub PasteUnfText()
    On Error GoTo oops
    Selection.PasteSpecial _
    DataType:=wdPasteText, _
    Placement:=wdInLine
    End
oops:
Beep
End Sub
http://www.gmayor.com/installing_macro.htm

which will cause the pasted text to adopt the paragraph style at the cursor
position.

Then you will have to laboriously make whatever edits you require and apply
styles to give the formatting you want - see
http://word.mvps.org/FAQs/Formatting/CleanWebText.htm

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

My web sitewww.gmayor.com
Word MVP web sitehttp://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

wildetudor wrote:
I encountered the following situation:
- I had a table in Word, whose Alignment was set to Left;
- I copied some text from a PDF article (Adobe Reader) that was laid
out on 2 columns; the line breaks are copied as well, such that when
you paste the text somewhere else, you have to manually delete all
the line breaks (carriage returns) yourself
- When I pasted the text into one of the table's cells, the text was
automatically alligned Right, with the exception of the last line
(i.e. last paragraphs, because of the line breaks). Other times the
lines are aligned Centered, but never Left, as they should be.

I have to do this operation many times, and it's irritating enough to
have to delete all the unnecessary line breaks, let alone to also
have to reenforce the Left alignment of the pasted text after each
Paste operation.

Word is set up to paste text from other programs by keeping text
only, so any alignment setting from Adobe Reader should not count.

If I paste text that doesn't have line breaks in it (as a result of
2-column page layout for example), then the pasted text looks fine in
the WOrd table, i.e. it is aligned Left as it should be.

Also, if I paste the same text outside of a table, the default Left
alignment is maintained, it's only when I paste into a table cell
that the alignment is altered.

Can anyone suggest why this is happening, and how I can get text that
has line breaks in it to be pasted in tables without bringing in a
different alignment? Anticipated thanks!-
.



Relevant Pages

  • Re: Change Format of Active Cell
    ... a better visual on a selection of multiple cells. ... Forgot about a single selection. ... I like this from Mike H. which restores existing formatting of any ...     With .FormatConditions ...
    (microsoft.public.excel.programming)
  • Re: Change Format of Active Cell
    ... a better visual on a selection of multiple cells. ... Forgot about a single selection. ... I like this from Mike H. which restores existing formatting of any ...     With .FormatConditions ...
    (microsoft.public.excel.programming)
  • Re: Change Format of Active Cell
    ... a better visual on a selection of multiple cells. ... Forgot about a single selection. ... I like this from Mike H. which restores existing formatting of any ...     With .FormatConditions ...
    (microsoft.public.excel.programming)
  • Re: Program to copy old weekly status sheet to new one
    ... it creates the new sheet and copies the formatting ... I manually selected to the other cells, ...
    (microsoft.public.excel.programming)
  • Re: how to set center alignment in JTable?
    ... I've used the following to set the alignment for cells in JTable... ... The DefaultTableCellRenderer is actually just a JLabel which JTable uses to ... Then you need to apply this renderer to your JTable. ...
    (comp.lang.java.programmer)