Page number

G

Hallo everybody. I have a problem with a document. I need to know, in every
moment, the page number in wich I am, and the total number of pages of
document.
May you help me? I don't find anything!
Many thanks.

 
T

Tony Jollans

Try these ...

Selection.Information(wdActiveEndPageNumber)
Selection.Information(wdNumberOfPagesInDocument)
 
G

Wonderful, now I have the datas I need. But now I have another problem: you
have ti know that i want do do a simple thing: I have two continuous
sections in the beginning of the documents, to change make the head of the
pages of the document different from the first one.
So, I'm trying do develop a code that, when an user writes, writes, writes
and... the document creates the second pages, the program knows that now the
page are two, and it runs a sub...
But the question is: how can I do to create the event which says "ok, now we
have an other page after the first"?

Thanks

 
T

Tony Jollans

You can't do that - Word just doesn't work that way.

But if what you want to do is just to have a different header on the first
page you do not need to have two sections or to check anything, Word will do
it all for you. Just check the box for "Different First Page" under Tools >
Page Setup > Layout tab - and then create your two different headers. You
will need to have two pages in the document to create the two headers but
you can delete the second page afterwards and the header will be remembered
for when the document really goes over a page.
 
G

Uhm... thank you very much! I'll try to do it!
The problem is that the second header is made by some datas available during
at the moment of the creation of the document: this is the reason for which
i need to use VBA instead a normal command button!
However now I try your method!
BYE, AND THANKS!

 

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