View Single Post
 
Old 07-03-2025, 01:47 AM
Bikram Bikram is offline Windows 10 Office 2007
Advanced Beginner
 
Join Date: Jul 2021
Location: Nepal
Posts: 97
Bikram is on a distinguished road
Default

First of all Thank you for replying.
I was using the following code to test the vertical Position but it returned correct position of paragraphs for one page and returned 72.5 for all paragraphs of another page and also got the same result from python code. I also discovered that when a cell of a table is selected and Selection.Range.Information(wdVerticalPositionRela tiveToPage) is executed than also wdVerticalPositionRelativeToPage would give position relative to that table and not page. So, I was wondering that is there something that i am missing or is it a bug?
Code:
Sub GetParagraphVerticalPositionsWithSelection()
    Dim para As paragraph
    Dim vertPos As Single
    For Each para In ActiveDocument.Paragraphs
        para.Range.Select
        vertPos = Selection.Range.Information(wdVerticalPositionRelativeToPage)
        Debug.Print ("Paragraph: " & para.Range.text & "Vertical Position: " & vertPos)
    Next para
End Sub
Reply With Quote