Hi
How to format the footer to display the page number like that 1 OF 4 if we have 4 pages
Thank's
Printable View
Hi
How to format the footer to display the page number like that 1 OF 4 if we have 4 pages
Thank's
Footer? What page?
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
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.
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
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
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