Determine the page number in Word VBA

S

sourceAK

So... Long story short I'm trying to bypass the 65536 row problem in Excel by
opening the file in Word and cutting it into smaller pieces.
Then I can keep track of the smaller pieces naming the file (Filename1,
filename2) and so on and open them in Excel, format them, remove all the junk
I don't want and put all the junk I do want on a single sheet.

When I open the document in Word I can jump to page 575 and cut up, move
that in a new document and save the file name.
The problem is I can't close the loop yet. If I could determine of the last
page is greater than 575 I could say something like "Do until LastPageNumber
< 575" and exit the loop.
As it is now it just copies the last page over and over again.

So how do I determine the last page in the document and stick it in a
variable?


Thanks!
 
D

Doug Robbins - Word MVP

Use ActiveDocument.BuiltInDocumentProperties(wdPropertyPages)

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 

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