Solved

VBA Word 2003:  Vertical Cursor Position as a Variable

Posted on 2007-04-04
2
1,197 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

943 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now