Information(wdHorizontalPositionRelativeToPage )

J

Jack

I got the horizontal position of a range like
ocell.Range.Information(wdHorizontalPositionRelativeToPage)
correctly for the first page of a document.

Starting the second page, all I got are values of -1
indicating that the range is outside the screen area. I
have done scrollintoview, largescroll and scrollpage. None
of them can move the range to return a meaningful
Information(wdHorizontalPositionRelativeToPage) value.

How do I move a range to the active window screen area?
 
C

Cindy M -WordMVP-

Hi Jack,

Version of Word?
Which view are you in when you run the code?
What does the document contain / in what is the range
contained on the other pages? In the first instance, it's
apparently a table cell...

Please post the entire segment of code (copy paste into a
reply) that's relative to your problem.
I got the horizontal position of a range like
ocell.Range.Information(wdHorizontalPositionRelativeToPage)
correctly for the first page of a document.

Starting the second page, all I got are values of -1
indicating that the range is outside the screen area. I
have done scrollintoview, largescroll and scrollpage. None
of them can move the range to return a meaningful
Information(wdHorizontalPositionRelativeToPage) value.

How do I move a range to the active window screen area?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep
30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow
question or reply in the newsgroup and not by e-mail :)
 
J

jack

It is Word Apllication Object 9.0.
The viewtype is wdNormalview.

The VB codes are as follows:

Set wrange = ocell.Range
wrange.MoveEnd Unit:=wdCharacter, Count:=-1

wrange.Select

ActiveDocument.ActiveWindow.View.Type = wdNormalView

ActiveWindow.ScrollIntoView Selection.Range, True

Print #af, wrange.FormattedText
Print #af,
wrange.InformationwdVerticalPositionRelativeToPage) &
wrange.InformationwdHorizontalPositionRelativeToPage)


The above codes return horizontzl positions and vertical
positions correctly for the first page. Starting the
second page, the horizontal position of the cell
returns -1 but the vertical positions are correct.


The document contains all tables. All tables are
contained within the same page , no spanning of tables
between pages.

Any insight ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top