getting page number

J

Jean-Baptiste

Hello,

My macro consist in looking for all commments in a document and getting
the page number.


I use somethong like this:

....
for each com in theDocument.Comments
number = com.Scope.Information(wdActiveEndPageNumber)
...
next

My problem is that each time Information is called it cause the document
to be repaginated which takes a long (wast of ) time.

How can I prevent this?
(it should be possible to just repaginate one time)

JB

Thanks
 
L

Leigh

The Range.Information() function always causes a repagination, as far
as I know. One way you could solve this would be to walk through the
document and note the Range.Begin value at the start of each page. You
could then compare the comments range.begin with these values to decide
which page the comment is on.
 
D

Dave Lett

Hi JB,

I _think_ you can turn off screenupdating to prevent Word from repaginating
each time.

Application.ScreenUpdating = False
'''insert your code
Application.ScreenUpdating = True

HTH,
Dave
 
J

Jean-Baptiste

Leigh said:
The Range.Information() function always causes a repagination, as far
as I know. One way you could solve this would be to walk through the
document and note the Range.Begin value at the start of each page. You
could then compare the comments range.begin with these values to decide
which page the comment is on.
How do you note the Range.Begin value at the start of each page?
How do you detect the start of a page?

The page number doesn't depend only on the document but it depends on
the printer properties too, this is why you need at least a repagination.
 

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