Results 1 to 7 of 7

Thread: Footer Page 1 of 2

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2003
    Posts
    233

    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

  2. #2
    Addicted Member JensPeder's Avatar
    Join Date
    Sep 2005
    Posts
    249

    Re: Footer Page 1 of 2

    Footer? What page?

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Nov 2003
    Posts
    233

    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

  4. #4
    Frenzied Member thegreatone's Avatar
    Join Date
    Aug 2003
    Location
    Oslo, Norway. Mhz:4800 x12
    Posts
    1,333

    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.
    Zeegnahtuer?

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Nov 2003
    Posts
    233

    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:
    1. appWord.Selection.HeaderFooter.PageNumbers.Add _
    2. PageNumberAlignment:=wdAlignPageNumberCenter

  6. #6
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: Footer Page 1 of 2

    You can use the AutoTextEntry to include the Page X of Y on the Footer.


    VB Code:
    1. Dim oWord As Word.Application
    2.     Dim oDoc As Word.Document
    3.     Dim oFooter As Range
    4.     Dim oRange As Range
    5.     Dim oEntry As AutoTextEntry
    6.    
    7.     Set oWord = New Word.Application
    8.     oWord.Visible = True
    9.    
    10.     Set oDoc = oWord.Documents.Add
    11.    
    12.     Set oFooter = oDoc.Sections(1).Footers(wdHeaderFooterPrimary).Range
    13.     Set oEntry = NormalTemplate.AutoTextEntries("Page X of Y")
    14.    
    15.     Set oRange = oEntry.Insert(oFooter)
    16.     oRange.ParagraphFormat.Alignment = wdAlignParagraphCenter
    17.    
    18.     oDoc.Close False
    19.     oWord.Quit False

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Nov 2003
    Posts
    233

    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:
    1. Set oDoc = oWord.Documents.Add

    This is my code
    VB Code:
    1. Dim oWord As object
    2. Dim oDoc As WORD.Document
    3.  
    4. set oWord = Createobject("Word.Application)
    5.      oWord.Visible = False
    6.      oWord.documents.Add
    7.  
    8. ' Here Code to make Dir for folder on the desktop and save the doc on it by given name
    9.  
    10. oDoc.Save
    11. 'Code to format the page
    12.  
    13. oWord.documents.Close
    14. oWord.Application.Quit
    15. 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
  •  



Click Here to Expand Forum to Full Width