I need to be able to create a custom footer that can extract a pre-determined portion of folder names. For example, our current footer is C:Current CustomersNortheast RegionSa-SmJoe Smith 12345.00orders 0001jsmith.docTAMpjf
The last item in the footer is the user initials-lower case, the second to last is author and the remainder of the footer is created via the autotext insert of the filename and path.
I would like to create the following revised footer: Sa-Sm12345.000001jsmith.docTAMpjf . I need to do this to ease privacy concerns about the detail revealed in the footer of the sales letter. As you can see from the revised footer, I no longer want to use the full path. The first item in the new footer is the folder Sa-Sm (i.e., the folder name will vary as its used to capture customers whose last name starts with Sa to Sm--I will always use the full folder name). Additionally, the second and third element of the new footer are numbers extracted from the respected folders (the folder Joe Smith 12345.00 shows in the footer as 12345.00 (i.e., I will always need the last eight charaters of the folder) and the folder orders 0001 becomes 0001 in the footer (i.e., I will always need the last 4 characters of this folder). Then the document name, author and user initials remain unchanged from the original footer. Once we start to use the new footer, the word document naming convention will also be changed to NOT reveal the customer name (i.e. this does not impact the creation of the new footer).
I have searched through the lounge and can't find anything close to this issue. Can this be done with VBA? If so, I need some sample code to get me started and finally, I need to understand if the code will change the footer anytime the file is saved to a new location or will the user need to re-run the code if the user changes any of the elements contained in the revised footer (i.e., the saved location of the document is changed or the document name or author is changed)? Since the current footer uses standard word fields--they automatically change to reflect the current saved location, etc.---even if the file saved location is modified from its original location during a subsequent edit process. I need to ensure that the code solution to create a new footer is always accurate just like the MS Word fields update automatically with the current footer using the standard Word fields. The automatic update of the fields in the new footer to reflect subsequent changes maybe my most difficult challenge with a VBA solution. THANKS.