Copying content from InternetExplorer to MSWord does NOT preserve formatting !!!

M

Michael Walsh

If I mark certain code lines on a web page in IntExp (5.5 under Win2000) e.g. one of the code samples with grey background on page

http://www.msdn.microsoft.com/xml/default.aspx?pull=/library/en-us/dnxmlnet/html/xmlgen.asp

then copy it to a new document in Word (2003) all the line formattings are lost!
The code text apprears as one continous line with line wraps.

Why?

Is there a way to preserve the line breaks (and indents) even if I copy the whole text?

Remember: I am NOT talking about loosing all formatting information for the whole text. Only certain parts
are not treated properly.

Michael
 
J

johnf

Same here.
Fix: Copy & paste to Notepad, copy that, Set Word to Landscape view & then
it pastes fine.
 
G

Graham Mayor

Edit > paste special > unformatted text

or by macro

Sub PasteUnfText()
On Error GoTo Oops
Selection.PasteSpecial DataType:=wdPasteText, Placement:= _
wdInLine
End
Oops:
Beep
End Sub

which is essentially the same thing, will do the trick. The line breaks will
be preserved, but how much will fit on a line depends on font size and
margin width.

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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