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 2006

Tip: Looking for answers? Try searching our database.

Insert text in different Word documents

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Micke - 08 Nov 2006 12:28 GMT
Hi!

I have a big problem and I hope you can help me!

Can you tell me how I insert same text in the beginning of hundreds of
different word documents.

...and the inserted text would preferably contain the name of the file.

I am a beginner so I hope you can help or give me an idea?
Shauna Kelly - 08 Nov 2006 13:08 GMT
Hi Micke

If wdDoc is a reference to a Word Document, then
   wdDoc.Range.InsertBefore "My text here"
will insert "My text here" before any existing text.

For an example of how to cycle through all the documents in a folder, see
Find & ReplaceAll on a batch of documents in the same folder
http://www.word.mvps.org/FAQs/MacrosVBA/BatchFR.htm

If that's not enough, and you need more help, post back here.

Hope this helps.

Shauna Kelly.  Microsoft MVP.
http://www.shaunakelly.com/word

> Hi!
>
[quoted text clipped - 6 lines]
>
> I am a beginner so I hope you can help or give me an idea?
 
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.