eliminating corruption from pasted in text

K

keith brickey

Many style, bullet, and numbering problems seem to start when text is pasted
in from another Word document. Can someone suggest a way to use VBA to get
text from another document without causing corruption?

Thanks,

Keith
 
D

Dave Lett

Hi Keith,

You might try to avoid using .Copy and .Paste. Instead, you could use the
..Text property of the .Paragraph object, as in the following example:

Dim odocCopyTo As Document
Dim odocCopyFrom As Document

odocCopyTo = ActiveDocument
odocCopyFrom = Documents(2)
odocCopyTo.Paragraphs(1).Range.Text = odocCopyFrom.Paragraphs(1).Range.Text

HTH,
Dave
 
P

Perry

odocCopyTo = ActiveDocument
odocCopyFrom = Documents(2)
adjust the above lines to read

Set odocCopyTo = ActiveDocument
Set odocCopyFrom = Documents(2)

Krgrds,
Perry
 

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