Find text in multiple DOCs and replace with image

D

Duane Hookom

I googled and checked various resources but couldn't find a solution to the
following.

The company I work for has a large number of Word 2000 documents with text
that needs to be replaced by an image. The text is actually in the Header
section and is a custom font that when typed as "abcdef" displays our
company logo. Assume the company name is Microsoft and abcdef displays as
the MS logo.

We save some documents to PDF using Writer version 7 which will not embed
copyrighted fonts (ours is and can't be changed). Therefore the logo doesn't
display.

I would like some direction on how to program the mass search and replace of
the abcdef text with an image file of the logo. Assume all the doc files are
in the folder "N:\ControlledDocuments\SOPS\". Also assume the files are not
password protected and I am comfortable with VBA. I would prefer to work in
Access where I could place all the file names in a table and loop through
the records. I could also work with looping through each doc file in a
folder.

Remember the abcdef text is in the header section and is formatted with the
"Microsoft Corp" font.

Let me know if you need any additional information.
 
D

Doug Robbins - Word MVP

Modify the code in the article "Find & ReplaceAll on a batch of documents in
the same folder" at:

http://www.word.mvps.org/FAQs/MacrosVBA/BatchFR.htm

so that it does what you want by have a Range object declared, setting it to
the range of the found text and then using

[Range object].InlineShapes.AddPicture Filename:=[drive:\path\filename of
logo]

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - 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