Loop through pictures

C

Cawshus

Hello all

I am experienced with Excel but am having problems with Word VBA,

I need to loop through a document that contains (amongst test) images
copied from the internet. I need to convert each image to Word metafile.
Kind of like the following which produces error:

Sub ConvertLinkdedPicture()
Dim shp As Shapes

For Each shp In ActiveDocument.Shapes
shp.Select

Selection.Copy
Selection.PasteAndFormat (wdPasteDefault)
' is this metafile?
Next shp
End Sub



--
Steve

Due to the volume of garbage I filter out googlegroups. So do many
others. Gmail posters are currently scored down pending troll filter
work.
 
C

Cawshus

Is this not possible?
Hello all

I am experienced with Excel but am having problems with Word VBA,

I need to loop through a document that contains (amongst test) images
copied from the internet. I need to convert each image to Word metafile.
Kind of like the following which produces error:

Sub ConvertLinkdedPicture()
Dim shp As Shapes

For Each shp In ActiveDocument.Shapes
shp.Select

Selection.Copy
Selection.PasteAndFormat (wdPasteDefault)
' is this metafile?
Next shp
End Sub
 
C

Cawshus

Is this not possible?

I guess not.

--
Steve

Due to the volume of garbage I filter out googlegroups. So do many
others. Gmail posters are currently scored down pending troll filter
work.
 
C

Cindy M.

Hi Cawshus,

Have you tried PasteSpecial (rather than PasteAndFormat)?
I am experienced with Excel but am having problems with Word VBA,

I need to loop through a document that contains (amongst test) images
copied from the internet. I need to convert each image to Word metafile.
Kind of like the following which produces error:

Sub ConvertLinkdedPicture()
Dim shp As Shapes

For Each shp In ActiveDocument.Shapes
shp.Select

Selection.Copy
Selection.PasteAndFormat (wdPasteDefault)
' is this metafile?
Next shp
End Sub

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 

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