Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / September 2006

Tip: Looking for answers? Try searching our database.

Format all pictures - inline with text

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ben h - 05 Sep 2006 03:16 GMT
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
Jay Freedman - 05 Sep 2006 04:20 GMT
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        FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.

>Word 2003.
>I have over 100 docs containing screen shots. Most of them were created
[quoted text clipped - 23 lines]
>TIA
>Ben
ben h - 07 Sep 2006 01:21 GMT
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

> Replace the line that tries to set wdWrapInline with the following:
>
[quoted text clipped - 40 lines]
>> TIA
>> Ben
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.