want to to change starting page number(Start at)

  • Thread starter hemaneelagiri via OfficeKB.com
  • Start date
H

hemaneelagiri via OfficeKB.com

hi
i want to change the document pagenumber which is in page header.
we can change directly with page number formating popup where we can give
start at:

but how can we set this property dynamically

Thanks
Hema
 
D

Doug Robbins - Word MVP

I am not sure what you mean by setting the property dynamically, but you can
set it use vba as follows:

Dim s as Section
For Each s In ActiveDocument.Sections
With s.Headers(wdHeaderFooterPrimary).PageNumbers
.RestartNumberingAtSection = True
.StartingNumber = 1
End With
Next s

--
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
 
H

hemaneelagiri via OfficeKB.com

Thanks for your reply. but with this code

the first 3 pages are coming properly.. if i give satrting number is 20 the
first 3 pages are comeing 20-22 and after pages are coming as 21, 21 like
that...
can u help me
 
D

Doug Robbins - Word MVP

What field codes do you have in the header/footer of the document? What
separates the first 3 pages from the rest of the document?

--
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
 
H

hemaneelagiri via OfficeKB.com

yeah first i explain how my document looks.

i am displying meeting details..

right now my document is having 3 pages

in first page meeting header means.. date time, particpants, location etc...
in 2nd page agenda details, where i can have many agendas so those agendas
are comeing in loop so those will display one by one..(2nd page data is in
loop)

and third page meeting sumamry
 
H

hemaneelagiri via OfficeKB.com

and when i am looping agendas
i am giving this

MsgBox "The selection is on page " & _
Selection.Information(wdActiveEndPageNumber) & " of page " _
& Selection.Information(wdNumberOfPagesInDocument)

when first agenda comes it is giving 1 of 3
and the next it is giving 4 of 4
and last is giving 5 of 5

hope this can help you, and above also i want to diply 1 of 3, 3 of 4, 4 of 5

means whiel creating data in loop that page is not inserting middile.
 
H

hemaneelagiri via OfficeKB.com

i got the solution for first problem
i have commented .PageNumbers.RestartNumberingAtSection = True

Now have to find second problem

i want to get the current selection page header "page number" not the
document page number means
when when selection is about to print data in document.. right that time what
is the page number in header, not the "Selection.Information
(wdActiveEndPageNumber)"

Tahnks




and when i am looping agendas
i am giving this

MsgBox "The selection is on page " & _
Selection.Information(wdActiveEndPageNumber) & " of page " _
& Selection.Information(wdNumberOfPagesInDocument)

when first agenda comes it is giving 1 of 3
and the next it is giving 4 of 4
and last is giving 5 of 5

hope this can help you, and above also i want to diply 1 of 3, 3 of 4, 4 of 5

means whiel creating data in loop that page is not inserting middile.
yeah first i explain how my document looks.
[quoted text clipped - 8 lines]
and third page meeting sumamry
 
H

hemaneelagiri via OfficeKB.com

sorry for irretating

when i have commented .PageNumbers.RestartNumberingAtSection = True

tha new pagenumbers are not at all coming.. those are always starts with 1
only..

but that is not the solution to me please ignore my previous mail

and help me

this is another

i want to get the current selection page header "page number" not the
document page number means
when when selection is about to print data in document.. right that time what
is the page number in header, not the "Selection.Information
(wdActiveEndPageNumber)"

Thanks

i got the solution for first problem
i have commented .PageNumbers.RestartNumberingAtSection = True

Now have to find second problem

i want to get the current selection page header "page number" not the
document page number means
when when selection is about to print data in document.. right that time what
is the page number in header, not the "Selection.Information
(wdActiveEndPageNumber)"

Tahnks
and when i am looping agendas
i am giving this
[quoted text clipped - 16 lines]
 

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