Reply
 
Thread Tools Display Modes
  #1   Report Post  
 
Posts: n/a
Default HELP page numbers in Word 2002 vba

Hello,
I'm not quite sure how to describe this but here goes:

I'm having trouble getting the current pagenumber into a variable for
my vba code.

I have a document divided into sections. I'd like to print the page
number in the footer. Here is the kick: I`d like the page number to
reset back to 1 on each sections.

SO unless there is a easy microsoft way to do this, i`m thinking of
incrementing a integer on each page change... But how do i know which
page i'm on?

Can anybody tell me how to retreive the current page number of a
range/paragraph/selection

  #2   Report Post  
Jay Freedman
 
Posts: n/a
Default

Hi Lilian,

Please don't reinvent the wheel. :-) There is already a feature in Word to
handle this, so you don't need a macro.

First to make su when you say the document is divided in sections, do you
mean you've inserted section breaks between them? That is necessary for the
next step to work.

Use the View Header & Footer menu item to open the header area and display
the Header/Footer toolbar. You should see a dashed box around the header
area, with "Section 1 Header" written in the upper left.

Click the Show Next button (near the right end of the Header/Footer
toolbar), so you see "Section 2 Header" written in the upper left.

Click the Format Page Number button (third from the left on the toolbar) to
open a small dialog. At the bottom of the dialog, click the Start At option,
and make sure "1" appears in the box to the right. Click OK.

Continue clicking Show Next and then Format Page Number until you've set
each section's Start At to 1.

If you haven't placed a page number in the header (or footer) yet, click the
Insert Page Number button on the toolbar (next to Insert AutoText). You can
insert one or two tab characters to the left of the page number to make it
centered or at the right margin.

Click the Close button on the Header/Footer toolbar. Check out your new page
numbers!

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org


wrote:
Hello,
I'm not quite sure how to describe this but here goes:

I'm having trouble getting the current pagenumber into a variable for
my vba code.

I have a document divided into sections. I'd like to print the page
number in the footer. Here is the kick: I`d like the page number to
reset back to 1 on each sections.

SO unless there is a easy microsoft way to do this, i`m thinking of
incrementing a integer on each page change... But how do i know which
page i'm on?

Can anybody tell me how to retreive the current page number of a
range/paragraph/selection



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Word 2002 installation problems LongTimeAlaskan Microsoft Word Help 1 January 14th 05 03:06 PM
word xp crashes after macros are recorded kharris0405 Microsoft Word Help 3 January 11th 05 10:50 PM
Word 2003 printing {PAGE} instead of page numbers Jayz Microsoft Word Help 2 December 7th 04 08:25 AM
Problem with Page Numbers in Index using Word 2002 jdkelley Microsoft Word Help 1 December 1st 04 03:32 PM
I am unable to insert page numbers in my footer in word 2002 the . rvm422 Microsoft Word Help 1 November 30th 04 03:16 PM


All times are GMT +1. The time now is 05:58 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"