First paragraph position in MS Word automation

A

Andrey Dzizenko

Hi!

Sometimes the first paragraph on the page is located incorrectly (when
using get_Information()) - at the bottom of the page.

Did anyone face with such problem? Could anyone make a guess what's the
problem?

Thank you in advance,
A. Dzizenko.
 
C

Cindy M.

Hi Andrey,
Sometimes the first paragraph on the page is located incorrectly (when
using get_Information()) - at the bottom of the page.

Did anyone face with such problem? Could anyone make a guess what's the
problem?
Does the paragraph across pages? What kind of code are you using to
determine the "first paragraph on the page"? Which version of Word are you
working with?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

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

Andrey Dzizenko

Does the paragraph across pages?

No it doesn't. Furthermore the paragraph is placed after a page break in
most cases. But I couldn't claim this.
What kind of code are you using to determine the "first paragraph on the
page"?

range.Select();
_application.ScreenRefresh();
float X =
(float)_application.Selection.get_Information(WdInformation.wdHorizontalPositionRelativeToPage);
float Y =
(float)_application.Selection.get_Information(WdInformation.wdVerticalPositionRelativeToPage);
Which version of Word are you working with?

Microsoft.Office.Interop.Word
Runtime Version v1.1.4322
Version 11.0.0.0
 
C

Cindy M.

Hi Andrey,
No it doesn't. Furthermore the paragraph is placed after a page break in
most cases. But I couldn't claim this.
This could be a clue. A manual page break is part of the paragraph that appears on the following
page. See if things function "as expected" when all manual page breaks are removed from (a copy
of) the document?

If that solves the problem, then you could format each paragraph that's currently linked with a
page break with "Page Break Before" (see Format/Paragraphs/Line and Page breaks).
range.Select();
application.ScreenRefresh();
float X =
(float) application.Selection.get Information(WdInformation.wdHorizontalPositionRelativeToPage);
float Y =
(float) application.Selection.get Information(WdInformation.wdVerticalPositionRelativeToPage);
this seems rather odd code to determine the first paragraph on a page... It only tells you the
location of the current selection. What's the purpose of making this determination?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

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

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