PDA

View Full Version : Solved: Counting number of pages in word



lifeson
04-24-2009, 05:28 AM
Hi all
I have a project that builds a 2 column table on a word document from an excel spreadsheet adding images and some text to each row of the table.

It builds the table by looping through a list on a spreadsheet

The majority of the time all the info fits onto one page of the word doc, however sometimes it will spill over onto 2 pages

Is there a way that during the loop routine it can identify when the word document will start a new page???? :dunno

Kenneth Hobs
04-24-2009, 05:42 AM
You would probably have more luck asking this in a Word forum.

Have you thought about using Word's FitToPages?

I don't do Word much but if the Word object names is wa then:
MsgBox wa.ActiveDocument.ActiveWindow.ActivePane.Pages.Count

lifeson
04-24-2009, 09:55 AM
Thanks Kenneth
Thats worked great :clap: and has solved the problem I asked.
But has given me another problem with headers and form fields which I will post in a new thread

Thanks again