Microsoft Word - Close button

Word 97/Word 2000
I have developed a document template. It is a global template that is put in the Startup folder. I use the document template just to store my menu items. The documents that I open will not be based on this template. Depending upon the menu item clicked upon, I enable/disable some menu items.  Now when I close Word I get the message "Changes have been made to the global template xxxx.dot. Would you like to save your changes?". I do not wish this message to appear, instead I want the changes that I have done to be discarded. Is there a way that this could be achieved?
Note:
1)As the documents that would be opened will not be based upon my template, handling the Close event or the AutoClose event did not help.
2)I do not want to save my menu items in the Normal.dot either as sometimes i get the message "Normal.dot was being edited by another session..."
3)Also saving the changes explicitly by doing a template.Save lead to problems in the case of multiple instances of Word.
 
SujathaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

antratCommented:
Hi sujatha

Put this bit of code in "ThisDocument" of your global template. It will trick word into thinking it has been saved.

Private Sub documentclose()
Application.Documents.Save = True
End Sub

antrat

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SujathaAuthor Commented:
Hi Antrat,
   Thank you for your quick response. I did put the piece of code that you had sent me in the ThisDocument of my template. But, as I had already made a mention in my note, as the Word documents are not based on my global template, the Document_Open event does not get fired at all.

Sujatha
0
SujathaAuthor Commented:
The event that I had used was Document_Close.  But have wrongly stated as Document_Open in my comment. As mentioned in my comment my problem still persists.
0
antratCommented:
Sorry about that I did not realise. Anyway it seems that procedures placed in "ThisWorkbook" do not have global scope.
But Auto Macros do, so if you place the macro below in a normal module for your template it should work.

Sub AutoClose()
Application.Documents.Save = True
End Sub

antrat
0
SujathaAuthor Commented:
AutoClose also gets fired only if you base the documents on your template.  I have tried that too.

Sujatha
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Office

From novice to tech pro — start learning today.