Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2004

Tip: Looking for answers? Try searching our database.

eliminating corruption from pasted in text

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
keith brickey - 10 Nov 2004 19:30 GMT
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
Dave Lett - 10 Nov 2004 19:35 GMT
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

> 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
[quoted text clipped - 3 lines]
>
> Keith
Perry - 10 Nov 2004 22:56 GMT
> odocCopyTo = ActiveDocument
> odocCopyFrom = Documents(2)
adjust the above lines to read

Set odocCopyTo = ActiveDocument
Set odocCopyFrom = Documents(2)

Krgrds,
Perry

> Hi Keith,
>
[quoted text clipped - 19 lines]
> >
> > Keith
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.