View Single Post
 
Old 09-24-2015, 08:47 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,369
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by anu_gv View Post
I ran the macro by clicking "Run Sub/UserForm, the screen shot is out of range
I'm not sure what you mean by that.
Quote:
Originally Posted by anu_gv View Post
When I ran the macro, it doesn't change the size of screen shots.
You'll recall from post # that I mentioned that macro working with screen shots inserted as floating shapes. Different code is required for screen shots inserted as inlineshapes. Try:
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim i As Long, sWdth As Single
With ActiveDocument.Range
  With .Sections(1).PageSetup
    sWdth = .PageWidth - .LeftMargin - .RightMargin - .Gutter - CentimetersToPoints(5)
  End With
  For i = 1 To .InlineShapes.Count
    With .InlineShapes(i)
      .LockAspectRatio = True
      .Width = sWdth
      With .Range.Paragraphs(1)
        If Len(.Range.Text) = 2 Then
          .LeftIndent = 0
          .RightIndent = 0
          .Alignment = wdAlignParagraphCenter
        End If
      End With
    End With
  Next
End With
Application.ScreenUpdating = True
End Sub
Although the above code will resize all the inline screenshots, it will only centre those that have no other text in the same paragraph. That's so you don't end up with a mass of centred text.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote