Finally, this macro will replace any existing footer, so if that's the case in your documents, you'll have to adjust the Range argument Sections whose footers are unlinked (Same As Previous turned off), you'll also need to add the footer to those sections. If your document uses "Different first page" or "Different odd and even", you'll need additional statements to put the same footer on those pages. The Range argument is now set to the primary footer of the first section of the document. Range:=.Sections(1).Footers(wdHeaderFooterPrimary).Range, _ Knowing these things, it's possible to rewrite the second macro to fix the problems: Third, there's nothing in the macro that would Second, the \* Lower switch makes the displayed path and name all lower case, which you may or may not want. Happens to be at the time you start the macro, and that could be in the middle of the document's text. First, it inserts the field wherever the cursor But it has a couple of problems for what you want to do. It just creates the FILENAME field directly. The second macro is safer because it doesn't depend on any external conditions that might not be there. There are two problems with this approach: first, that it depends on the existence of a Building Blocks.dotx template in theįolder path shown in the macro (and evidently you aren't Josephine, so that path doesn't exist on your computer) and second, that the template must contain a building block named FileNameandPathFooter, which it probably doesn't contain unless you created The first one, which mentions Building Blocks.dotx, inserts a building block entry that really consists of just the FILENAME field. This illustrates the dangers of grabbing code from somewhere without understanding how it works or what it's intended to do.įirst, both of these macros should do the same thing, so you need only one of them.
0 Comments
Leave a Reply. |