Macro for Paste Special - Picture (Enhanced Metafile)

O

Oriana

Hello! I am trying to set up a macro (key command alt+ctrl+p) that will
perform the following command: Paste Special - Picture (Enhanced Metafile).
I tried recording a macro to do this, and it came up with this:

Sub PasteMetafile()
'
' PasteMetafile Macro
'
'
Application.Run MacroName:="Normal.Module2.EditPasteSpecialâ€
End Sub

When I try to run it, it takes me to the "Paste Special" screen that pops
up, but it doesn't select Picture (Enhanced Metafile) for me. I found this
code from someone else:

AppWord.Selection.PasteSpecial Placement:=wdInLine,
DataType:=wdPasteMetafilePicture

....but it gives me Error 424 "Object required."

How can I make it specifically choose Picture (Enhanced Metafile)?

Just FYI, I have another macro set up already that tells Word whenever I use
Paste Special to paste everything as inline rather than floating.

Thank you!
 
O

Oriana

Actually, I sort've got it to work! I used:

Selection.PasteSpecial Placement:=wdInLine,
DataType:=wdPasteMetafilePicture

BUT - now here's what's happening.

I have graphs in Excel I am copying and pasting as Pictures (Enhanced
Metafiles) into Word (no linking involved). I have to go through and replace
a bunch of the pictures. When I use this paste special command manually, it
keeps the same formatting as the picture it is "replacing." Now, when I use
this macro, it changes the size of the picture. Can I code the macro to
somehow keep the same formatting as the object it's replacing?
 

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