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.

Automatically Sizing Photos with Macros

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
nate - 13 Mar 2008 19:57 GMT
I would like to add a number of pictures in Word 07 and have a macro
automatically size them to 2.25" x 3.00". What marco would I need to use?
Jean-Guy Marcil - 13 Mar 2008 20:46 GMT
> I would like to add a number of pictures in Word 07 and have a macro
> automatically size them to 2.25" x 3.00". What marco would I need to use?

For inline pictures:

Sub ResizeInlinePix()

Dim i As Long

With ActiveDocument.InlineShapes
   For i = 1 To .Count
       With .Item(i)
           If .Type = wdInlineShapePicture Then
               .Width = InchesToPoints(3)
               .Height = InchesToPoints(2.25)
           End If
       End With
   Next
End With

End Sub

And for floating pictures:

Sub ResizeFloatingPix()

Dim i As Long

With ActiveDocument.Shapes
   For i = 1 To .Count
       With .Item(i)
           If .Type = msoPicture Then
               .LockAspectRatio = msoFalse
               .Width = InchesToPoints(3)
               .Height = InchesToPoints(2.25)
           End If
       End With
   Next
End With

End Sub

Rate this thread:






 
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.