Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
document path footer
I have created a VBA script to automatically add the document path to the
footer of every page. When it works, it works OK, but it has the following problems: depending on how the document is opened it doesn't always run the formatting inherits the existing footer formatting instead of maintaining its' own does anybody know of a good macro to handle all this, or a 3rd party product that will do it ? -- Steve Paul |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
document path footer
Hi Steve,
This is a really bad case of reinventing the wheel. In the template used to create your documents, open the footer area. On the Header/Footer toolbar, click the AutoText button and select "Filename and path". That inserts a field that does the job. (Or you can insert the FileName field through the Insert Field dialog, and include the \p switch to show the path.) You can format the field as you like. Save the template, and use File New to create new documents based on it. Each document will automatically show its path and filename once it's been saved (although you may have to switch to Print Preview and back or manually select the field and press F9 to update it). One caution: If you ever use the Label wizard, don't put anything in the footer of the Normal.dot template because that will interfere with the labels. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. On Thu, 22 Dec 2005 10:41:01 -0800, "Steve Paul" wrote: I have created a VBA script to automatically add the document path to the footer of every page. When it works, it works OK, but it has the following problems: depending on how the document is opened it doesn't always run the formatting inherits the existing footer formatting instead of maintaining its' own does anybody know of a good macro to handle all this, or a 3rd party product that will do it ? |
#3
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
document path footer
Thanks for the info, but unfortunately I don't believe this solution helps
with the 20,000 documents I have already created, many of which have pre-existing footers. The requirement is that every word document printed includes a file path footer. Which means I need some programmatic means to insert this field info to every document before it is printed -- Steve Paul "Jay Freedman" wrote: Hi Steve, This is a really bad case of reinventing the wheel. In the template used to create your documents, open the footer area. On the Header/Footer toolbar, click the AutoText button and select "Filename and path". That inserts a field that does the job. (Or you can insert the FileName field through the Insert Field dialog, and include the \p switch to show the path.) You can format the field as you like. Save the template, and use File New to create new documents based on it. Each document will automatically show its path and filename once it's been saved (although you may have to switch to Print Preview and back or manually select the field and press F9 to update it). One caution: If you ever use the Label wizard, don't put anything in the footer of the Normal.dot template because that will interfere with the labels. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. On Thu, 22 Dec 2005 10:41:01 -0800, "Steve Paul" wrote: I have created a VBA script to automatically add the document path to the footer of every page. When it works, it works OK, but it has the following problems: depending on how the document is opened it doesn't always run the formatting inherits the existing footer formatting instead of maintaining its' own does anybody know of a good macro to handle all this, or a 3rd party product that will do it ? |
#4
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
document path footer
Hi Steve,
If you had mentioned at the beginning that you needed to affect existing documents, I would have answered differently. Regarding the problem with the code not running depending on how the document is opened: I assume you put the code in an AutoOpen macro. The article at http://support.microsoft.com/?kbid=286310 explains the behaviors you can expect. A solution may be to get rid of the AutoOpen macro and instead intercept the FilePrint and FilePrintDefault commands (http://www.word.mvps.org/FAQs/Macros...tSavePrint.htm) to insert the field just before printing. Alternatively, you could adapt the code in http://www.word.mvps.org/FAQs/MacrosVBA/BatchFR.htm to put the field into every document. If you try this, beware of read-only documents, password-protected documents, and other pitfalls. Regarding the formatting: What code are you using to insert the path now? There are several strategies for fixing the formatting of inserted text, but which one is easiest depends on what you're already doing. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. On Thu, 22 Dec 2005 13:19:03 -0800, "Steve Paul" wrote: Thanks for the info, but unfortunately I don't believe this solution helps with the 20,000 documents I have already created, many of which have pre-existing footers. The requirement is that every word document printed includes a file path footer. Which means I need some programmatic means to insert this field info to every document before it is printed -- Steve Paul "Jay Freedman" wrote: Hi Steve, This is a really bad case of reinventing the wheel. In the template used to create your documents, open the footer area. On the Header/Footer toolbar, click the AutoText button and select "Filename and path". That inserts a field that does the job. (Or you can insert the FileName field through the Insert Field dialog, and include the \p switch to show the path.) You can format the field as you like. Save the template, and use File New to create new documents based on it. Each document will automatically show its path and filename once it's been saved (although you may have to switch to Print Preview and back or manually select the field and press F9 to update it). One caution: If you ever use the Label wizard, don't put anything in the footer of the Normal.dot template because that will interfere with the labels. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. On Thu, 22 Dec 2005 10:41:01 -0800, "Steve Paul" wrote: I have created a VBA script to automatically add the document path to the footer of every page. When it works, it works OK, but it has the following problems: depending on how the document is opened it doesn't always run the formatting inherits the existing footer formatting instead of maintaining its' own does anybody know of a good macro to handle all this, or a 3rd party product that will do it ? |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Footer filename change everytime you save new document from Templ | Page Layout | |||
Footer filename change everytime you save new document from Templ | Page Layout | |||
'document or path name is not valid' when trying to open word doc | Microsoft Word Help | |||
How do I insert and path to find my document in word? | Microsoft Word Help | |||
Change Footer on pg 2 to be different then the footer on pg 1 | Microsoft Word Help |