alignment of pasted text with line breaks is altered in table cell

W

wildetudor

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!
 
G

Graham Mayor

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
W

wildetudor

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.
 
G

Graham Mayor

If I paste from a plain text file with line breaks into a table cell here,
the text retains the alignment and adopts the existing format of the table
cell?
This is the same in both Word 2003 and 2007?

What happens if you repeat the test having started Word its safe mode (hold
the CTRL key whilst starting and positively acknowledge the ensuing prompt)?
If you can then paste into a table without losing the table format the
implication is that you have a problem with the normal template - see
http://word.mvps.org/FAQs/AppErrors/ProblemsStartingWord.htm
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
G

grammatim

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.
 
W

wildetudor

Your suspicion was indeed correct - if I start Word in Safe Mode, then
pasting the plain text with line breaks in it retains the alignment setting
of the current cell of the table.

I think rather than my Normal.dotm being somehow correpted, this has
something to do with the custom table template that I have defined - this has
a default alignment of Top Center, however before pasting I do change that
cell's alignment to Top-Left, with the result being as described previously:
the setting is followed only for the last line, with the rest remaining
Centered.
 
W

wildetudor

Hm, if I select the whole cell and press Ctrl+Space, everything becomes
Centered as in the default table alignment. However the style within the cell
is constantly Normal, both before and after the pasting, so there is no style
defined particularly for that.
 
P

PamC via OfficeKB.com

In Word 2003 tables, it is better to avoid most font and horizontal cell
alignment settings in the table style. If you do and later apply manual
formatting, the results, as you have found, are unexpected. If you want font
face, size, and line spacing that are different from normal, create table
paragraph styles (eg, table text, table headings, table bullets) to apply in
the table.

The MS developers seemed to have fixed the problem in W2007: if you set the
default fonts for your document and then leave normal unchanged from the
defaults, and you can then set fonts and such
in the table style without causing conflicts between the "normals"( the table
normal and normal styles).



PamC

Hm, if I select the whole cell and press Ctrl+Space, everything becomes
Centered as in the default table alignment. However the style within the cell
is constantly Normal, both before and after the pasting, so there is no style
defined particularly for that.
Maybe your basic table cell style is set to right-justified, and all
the cells that look otherwise have special formatting applied on top
[quoted text clipped - 79 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top