Macro to format pictures

A

Art

Hi,

I find that I often need to copy pictures (for example screen prints) to
Word and then format them. Often I use the same formatting over and over.
I'd like to write a macro to do this for me. Unfortunately I'm not very
familiar with the Word object model.

I found the "crop" functions in the PictureFormat object. I haven't yet
found the "Size" (I'd often like 100%) or the "in front of text" type
options. Can anyone give me a hint as to where to look - or even if this is
possible?

Thanks,

Art
 
W

Word Heretic

G'day Art <[email protected]>,

Try using InlineShapes instead of the floating Shapes. You can't
reliably control the zorder (in front of, behind) of the shape through
VBA prior to Word 2003. I haven't tested Word 2003 yet but don't
expect improvements.

There are scaled properties for both height and width. If you use the
VBE's (Alt+F11) Object Explorer (F2) you can find the InlineShapes
object and check out its properties and methods.


Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice


Art reckoned:
 
D

David Macdonald

Since we don't know all the different things you want to do to your pictures,
I would recommend you record a macro whilst performing the formatting on one
picture.
Then go in and see what Word has recorded - there'll be a lot of unnecessary
lines but you can usually spot them as the values will be "0" and like Word
Heretic wrote they'll mostly be "Inline shape" commands.
 
A

Art

David,

Thanks -- oddly, I wanted to try that, but couldn't select the picture with
the macro recorder on. I thought this was just "one of those little
problems". When I read your note it occurred to me that I should be able to
do that. It turned out that all I had to do was to change the layout of the
picture (in front of text) before turning on the macro recorder -- and voila!
I could record.

Thanks,

Art
 

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