Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

vertical position relative to page

Posted on 2002-07-09
4
Medium Priority
?
393 Views
Last Modified: 2008-02-01
Does anyone know how to use

wdverticalPositionRelativeToPage?

I've tried it on the following line of code

msgbox Selection.Inormation(wdVerticalPositionRelativeToPage)
 
I was hoping it might tell me the current position of the selection. Instead it returns a -1 which means it is not visible.

How do I get this to work properly. It really is important.

Jerome


0
Comment
Question by:jcherry_99
  • 2
4 Comments
 
LVL 20

Accepted Solution

by:
hes earned 200 total points
ID: 7141716
Selection.Information(wdVerticalPositionRelativeToPage) does not return the correct value unless you are in Page view. In Normal view, it returns the distance from the top margin.

Always set the view to be Page view, with Magnification set to 100%, before using the Information property to get the cursor position.
0
 
LVL 5

Expert Comment

by:rpai
ID: 7141763
Dim objapp As New Word.Application

objapp.Documents.Open ("C:\Test.doc")
objapp.Visible = True
Debug.Print objapp.Selection.Information(wdVerticalPositionRelativeToPage)
0
 

Author Comment

by:jcherry_99
ID: 7145082
Thank you. This problem has been driving me (and others) nuts for quite awhile. All you have to do to insure that it is in page view is add a couple of lines and insure that the it is in the proper place. I was never to see a number other than -1 in my life.

The real question is to measure the change in height of a cell in a table. To do that, all you have to do is measure the change in selections from the top of the table to the bottom and subtract everytime you change something within the table. That question caused so much trouble that it was eventually deleted. I put it up again and got no response until I asked this question. It's great to have an answer.

Jerome.
0
 

Author Comment

by:jcherry_99
ID: 7145088
I tried the second comment I got and though interesting, I could not get it to work. Furthermore, I did not like the idea of a file being created. Were you using Word? Word 97's vba simply did not work the way I wanted it to. I wanted it to go within the current document and it did not.

Jerome.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

879 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