Question

Try recording a macro in Word 2007, notice you can't do a thing to pictures. (Or is this a local issue with my machine?)

And I can't even find the Picture / Image object within the Word Object Ref.

What gives?

Was it helpful?

Solution

In Word, images are internally handles as shapes. There are basically two types: InlineShapes, which are aligned inline with the text, and Shapes which are all shapes floating on a page.

You can access an image depending on its type either via

With ActiveDocument.InlineShapes(1)
    .Width = 300
    .Height = 200
End With

or

With ActiveDocuments.Shapes(1)
    .Width = 300
    .Height = 200
End With

OTHER TIPS

When recording you can't use your mouse to select anything so you have to use you keyboard to select the picture and then use the menu options to manipulate it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top