Insert text in different Word documents

M

Micke

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?
 
S

Shauna Kelly

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
 

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