View Single Post
 
Old 07-18-2019, 05:58 AM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,142
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

wdEndOfRangeColumnNumber relates to tables as you have discovered however following that line of thought you could use instead the horizontal page position to determine where the cursor or range is e.g. as in the following function. The three figures are the horizontal page positions of the three left margins.

Code:
Function WhichPageCol(oRng As Range) As Long
    Select Case True
        Case oRng.Information(wdHorizontalPositionRelativeToPage) >= 72 And _
             oRng.Information(wdHorizontalPositionRelativeToPage) <= 316.5
            WhichPageCol = 1
        Case oRng.Information(wdHorizontalPositionRelativeToPage) >= 316.5 _
             And oRng.Information(wdHorizontalPositionRelativeToPage) <= 561
            WhichPageCol = 2
        Case oRng.Information(wdHorizontalPositionRelativeToPage) >= 561
            WhichPageCol = 3
    End Select
End Function
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote