Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    May 2002
    Location
    Melbourne, Australia
    Posts
    269
    Thanks
    32
    Thanked 0 Times in 0 Posts

    Format Picture macro (Word 2002 SP3)

    Hi All

    It would be very useful to have a macro to do some simple formatting of pictures I am regularly inserting into documents. I tried to record such a macro, but failed miserably because the Layout tab was greyed out and specific size information was saved instead of percentage information.

    What I need this macro to do, once I have clicked on the picture, is:

    1. Re-size the picture to 80% relative to the picture size (with lock aspect ratio ticked)
    2. Wrapping style = Tight
    3. Horizontal alignment = Center

    I would be very grateful if someone more clever than me could help.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Format Picture macro (Word 2002 SP3)

    Try this:

    Sub FormatPicture()
    If Selection.Type = wdSelectionInlineShape Then
    Selection.InlineShapes(1).ConvertToShape
    ElseIf Not (Selection.Type = wdSelectionShape) Then
    MsgBox "Please select a picture!", vbExclamation
    Exit Sub
    End If
    With Selection.ShapeRange
    .RelativeHorizontalPosition = wdRelativeHorizontalPositionPage
    .Left = wdShapeCenter
    .WrapFormat.Type = wdWrapTight
    .LockAspectRatio = msoTrue
    .ScaleHeight 0.8, msoTrue
    .ScaleHeight 0.8, msoTrue
    End With
    End Sub

  3. #3
    3 Star Lounger
    Join Date
    May 2002
    Location
    Melbourne, Australia
    Posts
    269
    Thanks
    32
    Thanked 0 Times in 0 Posts

    Re: Format Picture macro (Word 2002 SP3)

    Hans, you are great!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •