Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Page {PAGE} of {NUMPAGES} in Word

Page {PAGE} of {NUMPAGES} in Word

Scheduled Pinned Locked Moved C#
learningcombusinessquestiondiscussion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jhaga
    wrote on last edited by
    #1

    I am doing a report programmatically(with COM) using Word 2003. First I build the report and print it. Then the idea is to remove all headers and footers(with logos etc) and print it again with only Page {PAGE} of {NUMPAGES} in the header. I can remove the headers and footers but can't add the pagenumbering . There probably is som escape code I should use or then it is just impossible. Any ideas? Of course I could use two different .dot files but is too slow for me. jhaga It would be glorious to see mankind at leisure for once. It is nothing but work, work, work. I cannot easily buy a blank-book to write thoughts in; they are commonly ruled for dollars and cents. A[man], seeing me making a minute in the fields, took it for granted that I was calculating my wages. — business! - I think that there is nothing, not even crime, more opposed to poetry, to philosophy, ay, to life itself, than this incessant business. Henry David Thoreau -- modified at 6:50 Tuesday 2nd May, 2006

    A 1 Reply Last reply
    0
    • J jhaga

      I am doing a report programmatically(with COM) using Word 2003. First I build the report and print it. Then the idea is to remove all headers and footers(with logos etc) and print it again with only Page {PAGE} of {NUMPAGES} in the header. I can remove the headers and footers but can't add the pagenumbering . There probably is som escape code I should use or then it is just impossible. Any ideas? Of course I could use two different .dot files but is too slow for me. jhaga It would be glorious to see mankind at leisure for once. It is nothing but work, work, work. I cannot easily buy a blank-book to write thoughts in; they are commonly ruled for dollars and cents. A[man], seeing me making a minute in the fields, took it for granted that I was calculating my wages. — business! - I think that there is nothing, not even crime, more opposed to poetry, to philosophy, ay, to life itself, than this incessant business. Henry David Thoreau -- modified at 6:50 Tuesday 2nd May, 2006

      A Offline
      A Offline
      alexey N
      wrote on last edited by
      #2

      Try to start record a macro, and do manually what you want. After that copy and modify macro code to your language. This helps me, when I was making export to Excel. Best regards, Alexey.

      J 1 Reply Last reply
      0
      • A alexey N

        Try to start record a macro, and do manually what you want. After that copy and modify macro code to your language. This helps me, when I was making export to Excel. Best regards, Alexey.

        J Offline
        J Offline
        jhaga
        wrote on last edited by
        #3

        Thanks, it is in VB: NormalTemplate.AutoTextEntries("Page X of Y").Insert Where:=Selection. _ Range, RICHTEXT:=True had missed that it is richtext :doh: jhaga It would be glorious to see mankind at leisure for once. It is nothing but work, work, work. I cannot easily buy a blank-book to write thoughts in; they are commonly ruled for dollars and cents. A[man], seeing me making a minute in the fields, took it for granted that I was calculating my wages. — business! - I think that there is nothing, not even crime, more opposed to poetry, to philosophy, ay, to life itself, than this incessant business. Henry David Thoreau

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups