Link to home
Start Free TrialLog in
Avatar of jcherry_99
jcherry_99

asked on

vertical position relative to page

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


ASKER CERTIFIED SOLUTION
Avatar of hes
hes
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rpai
rpai

Dim objapp As New Word.Application

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

ASKER

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.
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.