P
Peter
How can I change the Visible/Enabled properties of custom toolbar buttons in a template, and silently discard the changes on exit? I'm specifically targeting Word 2000 - 2003.
I am working on a template that has a custom CommandBar with a set of custom buttons (that invoke macros in the template) that I programmatically display/hide/enable/disable based on content in the ActiveDocument. I need the visibility changes to be temporary, or I need some way to programmatically close/save the document without the user being prompted to save changes to the template.
I have also tried adding buttons using Temporary:=True instead of setting the Visible/Enabled properties of existent buttons, but Word still wants to save changes to the template.
I've tried setting CustomizationContext = ActiveDocument, then changing/adding buttons, but that messes up the document, natch.
One of the custom buttons is a "close" button that invokes a macro named "exitApp()", which has one line in it: "Call Application.Quit(SaveChanges:=wdDoNotSaveChanges)". Closing the document via the special "close" button doesn't bring up the "Do you want to save changes to the template?" dialog. Closing the document by clicking on the "X" in the upper right-hand corner shows the template save dialog, so I added the line from exitApp() to the end of the AutoClose macro, to no avail.
Additionally, saving the document brings up a "do you also want to save changes to the template?" dialog.
Any ideas?
-Peter
I am working on a template that has a custom CommandBar with a set of custom buttons (that invoke macros in the template) that I programmatically display/hide/enable/disable based on content in the ActiveDocument. I need the visibility changes to be temporary, or I need some way to programmatically close/save the document without the user being prompted to save changes to the template.
I have also tried adding buttons using Temporary:=True instead of setting the Visible/Enabled properties of existent buttons, but Word still wants to save changes to the template.
I've tried setting CustomizationContext = ActiveDocument, then changing/adding buttons, but that messes up the document, natch.
One of the custom buttons is a "close" button that invokes a macro named "exitApp()", which has one line in it: "Call Application.Quit(SaveChanges:=wdDoNotSaveChanges)". Closing the document via the special "close" button doesn't bring up the "Do you want to save changes to the template?" dialog. Closing the document by clicking on the "X" in the upper right-hand corner shows the template save dialog, so I added the line from exitApp() to the end of the AutoClose macro, to no avail.
Additionally, saving the document brings up a "do you also want to save changes to the template?" dialog.
Any ideas?
-Peter