Solved

VBA Word 2003:  Vertical Cursor Position as a Variable

Posted on 2007-04-04
2
1,206 Views
Last Modified: 2008-01-09
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
0
Comment
Question by:jtaylerg
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 59

Accepted Solution

by:
Chris Bottomley earned 500 total points
ID: 18851064
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
0
 

Author Comment

by:jtaylerg
ID: 18855253
Thanks Chris!

I wasn't using the vert_single...

Thank you -- thank you!

~JTG
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question