

Before we do that, however, let’s talk about the rest of the script. So what is this trick? We’ll explain that in just a second. ObjTemplate.AutoTextEntries(“Page X of Y”).Insert objRange Set objTemplate = objDoc.AttachedTemplate Set objRange = objDoc.Sections(1).Footers(1).Range And once you figure out the trick, well, guess what? You really can add a Page X of Y footer to a Word document: Set objWord = CreateObject(“Word.Application”) End of discussion.Įxcept, as it turns out, there’s a trick to it.

#How to add page x of y in word 2011 mac how to#
And if the Scripting Guy who writes this column can’t figure out how to do something then it must be impossible. This question has come up before, and the Scripting Guy who writes this column couldn’t figure out how to do. We mention this simply because the Scripting Dad also believed it was impossible to programmatically add a Page X of Y footer to a Word document. After all, if the Scripting Dad says something is impossible then it must be impossible. “Please, let me have just one dollar? I know I can do it.”īut the Scripting Dad remained resolute. “No, Dad, there’s a trick to it, and I figured out what the trick is,” replied the Scripting Son. “This game is impossible,” the Scripting Dad told the Scripting Son. For awhile the Scripting Dad indulged his son, but it wasn’t long before Dad got tired of wasting a dollar each time they went to the store after all, despite his best efforts the Scripting Son never even came close to winning any prize, let alone a really cool prize. Back then the Scripting Son was infatuated with the idea of winning one of the big prizes. You know, several years ago the grocery store by the Scripting House included one of those claw-type arcade games you know, the kind where you maneuver this big claw around and try to grab a prize. However, I need my page numbers to be in the format “Page X of Y,” where X is the current page number and Y is the total number of pages. Hey, Scripting Guy! I saw your article on adding page numbers to the footer of a Word document.
