|
-
Jan 29th, 2006, 12:06 PM
#1
Thread Starter
Addicted Member
Footer Page 1 of 2
Hi
How to format the footer to display the page number like that 1 OF 4 if we have 4 pages
Thank's
-
Jan 29th, 2006, 12:19 PM
#2
Addicted Member
-
Jan 29th, 2006, 12:41 PM
#3
Thread Starter
Addicted Member
Re: Footer Page 1 of 2
I have textbox and it saved in word document and i want to add page number to the word document and i want to be like that if i have 4 page's 1 of 4 for the first page and 2 of 4 for the seconde page and so on
Thank's
-
Jan 29th, 2006, 01:21 PM
#4
Re: Footer Page 1 of 2
Is this VB6, or VBA ?
I'm a little confused by how you're trying to accomplish it. Although i understand what you want to do.
-
Jan 29th, 2006, 01:31 PM
#5
Thread Starter
Addicted Member
Re: Footer Page 1 of 2
It Is in VB6
I use this code It just number the page's like that 1, 2, 3 and 4 for the last page
VB Code:
appWord.Selection.HeaderFooter.PageNumbers.Add _
PageNumberAlignment:=wdAlignPageNumberCenter
-
Jan 29th, 2006, 04:44 PM
#6
Re: Footer Page 1 of 2
You can use the AutoTextEntry to include the Page X of Y on the Footer.
VB Code:
Dim oWord As Word.Application
Dim oDoc As Word.Document
Dim oFooter As Range
Dim oRange As Range
Dim oEntry As AutoTextEntry
Set oWord = New Word.Application
oWord.Visible = True
Set oDoc = oWord.Documents.Add
Set oFooter = oDoc.Sections(1).Footers(wdHeaderFooterPrimary).Range
Set oEntry = NormalTemplate.AutoTextEntries("Page X of Y")
Set oRange = oEntry.Insert(oFooter)
oRange.ParagraphFormat.Alignment = wdAlignParagraphCenter
oDoc.Close False
oWord.Quit False
-
Jan 30th, 2006, 06:46 AM
#7
Thread Starter
Addicted Member
Re: Footer Page 1 of 2
Thank's brucevde
This code help me but can i make Footer like that 1 Of 4 rather than Page 1 of 4
What's wrong with this code not working with the code i use and add new page and dilogbox open to save the word as new document
VB Code:
Set oDoc = oWord.Documents.Add
This is my code
VB Code:
Dim oWord As object
Dim oDoc As WORD.Document
set oWord = Createobject("Word.Application)
oWord.Visible = False
oWord.documents.Add
' Here Code to make Dir for folder on the desktop and save the doc on it by given name
oDoc.Save
'Code to format the page
oWord.documents.Close
oWord.Application.Quit
Set oWord = Nothing
Last edited by jamal464; Jan 30th, 2006 at 06:55 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|