![]() |
|
|
|
#1
|
|||
|
|||
|
You are right - macro is not in the footer - said it wrong. I want the macro to execute a function in the footer. As well, I changed my document to .dotm yesterday after reading copious amounts of info online. Still not working. Here is exactly what I want to do - I have a "base" document that I am doing a directory merge into to produce 1 new document with all my data in a table format. Works perfectly. However, the base document has my macros, which are to update my file name in the footer when the new document is "saved as" (via print preview). This is not working. If I "save as" before executing the merge the correct doc name appears in the footer; however, if I were to "save as" again after the merge, it won't update. Here are the macros:
Sub UpdateAllFields() Dim currentView As WdViewType currentView = ActiveWindow.View Options.UpdateFieldsAtPrint = True ActiveWindow.View = wdPrintPreview ActiveWindow.View = currentView End Sub Sub FileSaveAs() Dim dlg As Dialog Set dlg = Dialogs(wdDialogFileSaveAs) dlg.Show UpdateAllFields End Sub I am setting up a range of template documents that are schedules to legal documents and essentially are the same template; however, the data being merged into them changes, depending on the template. I have a team of users who will be doing the "mass production" of these documents and am trying to have them set up so there is continuity and uniformity to all the documents despite the number of people who will be using them. The only way to differentiate between all of these documents is to be sure the file name is accurate in each footer. Thanks for your time
|
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Can DocumentBeforeSave replace FileSaveAs
|
Macer | Word VBA | 2 | 06-05-2015 10:03 PM |
This macros are not working in office english version 2007
|
hans | Excel Programming | 4 | 12-10-2011 07:03 AM |
Macros not working when template is emailed
|
EMH | Excel Programming | 1 | 07-06-2011 09:24 AM |
Macros not working in word 2010
|
louise_chapman | Word VBA | 3 | 10-25-2010 08:34 AM |
| FileSaveAs with Code | bsmith | Office | 0 | 01-05-2006 08:43 AM |