VBA Word 2003:  Vertical Cursor Position as a Variable

jtaylerg
jtaylerg used Ask the Experts™
on
I'm trying to format a paragraph based on vertical cursor position.  If it's at this position then do this... if it's at that position, do that, etc.

I was able to use the Selection.Information(wdVerticalPositionRelativeToTextBoundary) to determine the cursor position.  Is there anyway to retrieve this information and set it as a variable?  

Thanks for your help!  JTG
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Software Quality Lead Engineer
Top Expert 2011
Commented:
Not sure I understand the problem, but I note with interest the 'command' as a numpty it's not one i've come across.  It can be set to a variable easily as I guess you know so I am obviously missing something.

Sub ee_22491486()
Dim vert_int As Integer
Dim vert_single As Single
    vert_int = CInt(Selection.Information(wdVerticalPositionRelativeToTextBoundary))
    vert_single = Selection.Information(wdVerticalPositionRelativeToTextBoundary)
End Sub

Author

Commented:
Thanks Chris!

I wasn't using the vert_single...

Thank you -- thank you!

~JTG

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial