Batch Replace Graphics in Multiple Word Docs

O

Oriana

Hello! I have 210 documents that I am working on. The basics: I have a main
document that I set up mailmerge fields in. After running the mailmerge,
there are 3-4 graphics that I have to manually replace in every single
document. There is one graphic that is the same in every document, but I've
updated the graphic and need to replace it in all 210 documents.

Is there a way to batch replace graphics? I've used programs/methods to
batch replace words in multiple documents, but never graphics. If this is
possible, I would really appreciate some help!

Oh, and for the record - the grahpics are graphs that I have copied from
Excel and pasted into Word as a Picture (Enhanced Metafile).

Thank you!
 
S

Suzanne S. Barnhill

If the graphics are linked, you can display field codes and use Replace to
update the path.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org
 
O

Oriana

Suzanne,

Thank you for your swift response! Unfortunately, the graphics are not
linked. I needed the graphics to be as crisp-looking as possible when
inserted into my Word documents, so they are just copied/pasted as Pictures
(Enhanced Metafiles).

If it's not possible to batch replace them in each document, then perhaps
would you (or anyone else) know a macro I can set up with a key command to
perform the following: "Paste -> Paste Special -> Picture (Enhanced
Metafile)?" That would at least make my work go a little faster. I found
one that I was testing out earlier, but the problem is it pastes the picture
on top of the other one I already have in there. When I do this command
manually, I select the picture and then do the Paste Special thing and it
*replaces* the picture that's currently there. That's what I need the macro
to do, too.

I already have this macro working:
http://word.mvps.org/faqs/drwgrphcs/inlinepastespec.htm so at least when I
paste things manually, it pastes the picture as inline instead of floating.
That saves me one step.
 
O

Oriana

I figured out a macro:

Sub PasteMetafile()
'
' PasteMetafile Macro
'
'
Selection.PasteSpecial Placement:=wdInLine,
DataType:=wdPasteMetafilePicture
End Sub

But now, when it pastes the picture, it doesn't keep the source formatting.
For some reason, it's increasing the size of the picture when it pastes. Not
sure if there's a way to tell it to keep the source formatting or not.
Cross-posted this to the programming forum since this turned into more of a
programming issue, rather than a graphics-specific issue.
 
S

Suzanne S. Barnhill

I'm not sure what linking has to do with sharpness. If a graphic is saved in
a graphic format and can be inserted using Insert | Picture | From File,
then you can link it and get exactly the same quality it would have it
embedded. Wherever you're pasting the graphics from, you may be able to
actually save them as files and then insert them in Word.

That's just a suggestion for next time, however, and doesn't help in your
current situation. It sounds as if you're well on your way to a working
macro. If you will post the code here or in
microsoft.public.word.vba.general, perhaps someone can help you fine-tune
it.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org
 

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