Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / February 2005

Tip: Looking for answers? Try searching our database.

getting page number

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jean-Baptiste - 04 Feb 2005 10:47 GMT
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
Leigh - 04 Feb 2005 12:31 GMT
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.
Jean-Baptiste - 09 Feb 2005 15:25 GMT
> 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.
Dave Lett - 04 Feb 2005 14:00 GMT
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

> Hello,
>
[quoted text clipped - 18 lines]
>
> Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.