Format all pictures - inline with text

B

ben h

Word 2003.
I have over 100 docs containing screen shots. Most of them were created
by Alt+PrntScrn and paste.
The pictures are mostly set with their text-wrapping at the apparent
default of 'Top and bottom', but I want to change this to 'In line with
text'.

I tried to record a macro of this manual process (i.e. selecting an
image, using the picture toolbar to change the text wrapping), but the
options in the picture toolbar were disabled, and the In line option on
the Format>Picture menu is disabled (though none of the others are??).

How would I write a macro that sets the text wrapping of all images in
the document to 'In line with text'?

'''''''''''''''''''''''''''''''''''''''''''''
For each objImg in ActiveDocument.Shapes
If objImg.Type = msoPicture Then
objImg.WrapFormat.Type = wdWrapInline
End If
Next objImg
'''''''''''''''''''''''''''''''''''''''''''''

This doesn't seem to work. What have I done wrong, or forgotten to do?

TIA
Ben
 
J

Jay Freedman

Replace the line that tries to set wdWrapInline with the following:

objImg.ConvertToInlineShape

The WrapFormat.Type documentation is misleading. The problem is that,
in the object model, Shapes (all the floating graphics) are in one
collection and InlineShapes (only the inline ones) are in a different
collection. You can't change one into the other simply by changing the
WrapFormat.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 
B

ben h

Thanks Jay!
I finally got a chance to try this, and it does exactly as you say. I'm
much less annoyed at myself now, knowing the docs aren't exactly
comprehensive for this.

Ben
 

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