Q
qnever
I want to get the position relative to page of a paragraph in word 2007.
However, I can only get the correct positions of paragraphs in the first
page. But with the same macros in word 2003, I got all positions of
paragraphs in every page correctly. Below is my macro.
Thanks!
Sub Test()
Dim i As Paragraph, myInfo As String, myRange As Range
For Each i In ActiveDocument.Content.Paragraphs
If i.OutlineLevel < 10 And i.Range.Information(wdWithInTable) =
False Then
myInfo = myInfo &
i.Range.Information(wdVerticalPositionRelativeToPage) & " "
End If
Next
MsgBox myInfo
End Sub
However, I can only get the correct positions of paragraphs in the first
page. But with the same macros in word 2003, I got all positions of
paragraphs in every page correctly. Below is my macro.
Thanks!
Sub Test()
Dim i As Paragraph, myInfo As String, myRange As Range
For Each i In ActiveDocument.Content.Paragraphs
If i.OutlineLevel < 10 And i.Range.Information(wdWithInTable) =
False Then
myInfo = myInfo &
i.Range.Information(wdVerticalPositionRelativeToPage) & " "
End If
Next
MsgBox myInfo
End Sub