Public Sub aaa()
Dim e
For Each e In ActiveDocument.Shapes
MsgBox "Shap: " & e.Name & " 在 第" & ffffiiii(e.id) & "页"
Next
End Sub
Public Sub bbb()
On Error GoTo NNNN
MsgBox "当前选中的Shap:'"& Selection.ShapeRange.Name &"'在第"& ffffiiii(Selection.ShapeRange.id) &"页"
Exit Sub
NNNN:
MsgBox "没有 Shap 被选中。"
End Sub
Private Function ffffiiii(id As Long) As Long
Dim e, r
For Each e In ActiveDocument.ActiveWindow.ActivePane.Pages
For Each r In e.Rectangles
If wdShapeRectangle = r.RectangleType Then
If id = r.Range.ShapeRange.id Then
ffffiiii = e.Breaks(1).PageIndex
End If
End If
Next
Next
End Function