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 / March 2008

Tip: Looking for answers? Try searching our database.

Auto format image layout in Word?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
pjs - 08 Mar 2008 15:55 GMT
I have to create a syllabus for a talk. I sent my slides and notes from
PowerPoint to Word. Now I would like to shrink all of the slide images to 1"
by 1.33" and format them so they are left aligned with text wrapping around
the right side.

I tried doing this one by one with Record Macro, but it wouldn't let me do
the alignment part.

Is there a macro that can do this? I'm very, very new to VBA.

Thanks,

pjs
macropod - 10 Mar 2008 09:35 GMT
Hi pjs,

The following macro will reformat all your document's 'floating' shapes:
Sub Reformat()
   Dim oShp As Shape
   For Each oShp In ActiveDocument.Shapes
       With oShp
           '.LockAspectRatio = msoFalse
           .Height = InchesToPoints(1)
           '.Width = InchesToPoints(1.33)
           .RelativeHorizontalPosition = wdRelativeHorizontalPositionMargin
           .Left = wdShapeLeft
           With .WrapFormat
               .AllowOverlap = False
               .Side = wdWrapRight
               .DistanceTop = InchesToPoints(0)
               .DistanceBottom = InchesToPoints(0)
               .DistanceLeft = InchesToPoints(0)
               .DistanceRight = InchesToPoints(0)
               .Type = wdWrapTopBottom
           End With
       End With
   Next
MsgBox "Finished Reformatting."
End Sub

Note that there are two lines commented out. Ordinarily, the aspect ratio is locked, so changing the height affects the width also.
If it doesn't, then uncomment the line '.Width = InchesToPoints(1.33)'. If you're wanting to change the aspect ratio also, also
uncomment the line '.LockAspectRatio = msoFalse'.

If you only want to work with the selected shape(s), change 'For Each oShp In ActiveDocument.Shapes' to 'For Each oShp In
Selection.ShapeRange'

Cheers
Signature

macropod
[MVP - Microsoft Word]
-------------------------

>I have to create a syllabus for a talk. I sent my slides and notes from
> PowerPoint to Word. Now I would like to shrink all of the slide images to 1"
[quoted text clipped - 9 lines]
>
> pjs
 
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.