Thread: [Solved] Get page number from object
View Single Post
 
Old 04-17-2018, 04:20 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,385
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

Try something based on:
Code:
Sub Demo()
Dim SBar As Boolean, oShp As Shape, i As Long, j As Long
With Application
  .ScreenUpdating = False
  SBar = .DisplayStatusBar
  .DisplayStatusBar = True
End With
For Each oShp In ActiveDocument.Shapes
  With oShp
    i = .Anchor.Information(wdActiveEndPageNumber)
    If i <> j Then
      StatusBar = "Processing page: " & i
      j = i
    End If
    If .Type = msoTextBox Then
      Do While .TextFrame.Overflowing
        .TextFrame.TextRange.Font.Shrink
      Loop
    End If
  End With
Next
With Application
  .StatusBar = False
  .DisplayStatusBar = SBar
  .ScreenUpdating = True
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote