Solved

vertical position relative to page

Posted on 2002-07-09
4
388 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
[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
4 Comments
 
LVL 20

Accepted Solution

by:
hes earned 50 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

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…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…

740 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