Re: Catching document save event

From: Chad DeMeyer (cjdemeye)
Date: 08/18/04


Date: Wed, 18 Aug 2004 11:28:58 -0700

Mike,

This is not something you can trap by hooking an event, but what you can do
is override Word's built in save functions by giving procedures in your
template the same name as the built-in Word commands. Try this:

Go to Tools>Macro>Macros. In the 'Macros in' dropdown, select 'Word
commands'. From the list, select 'FileSave'. Now click the 'Macros in'
dropdown again, and select your template. Now click create. A macro is
created in your template that replaces the built-in command. When you use
this method, the default code is supplied as a starting point, and you can
now modify it rather than starting from scratch.

At a minimum, you will want to have FileSave and FileSaveAs macros in your
template. You may want to also look at some of the other commands such as
FileSaveHTML, etc.

Regards,
Chad

"Mike" <Mike@discussions.microsoft.com> wrote in message
news:A999A412-7092-42F4-84C2-FC626DCBF091@microsoft.com...
> Hi! I am developing a .dot to be used by all people in our company to
compose
> documents. I need to catch document Save event. How do I do it? What
object
> does it belong to ? I can not seem to find this info anywhere.
>
> Please let me know if you came across this problem.
>
> Many Thanks in Advance,
>
> --Mike Z.....



Relevant Pages

  • Re: Preventing macro from copying over from template to document
    ... Then the document will be attached to Normal.dot, not to the template. ... and create a routine in it called FileSave Put the ... Thats got rid of the Enable Macros dialog, ... a sub, etc. ...
    (microsoft.public.word.vba.general)
  • Re: How can I allow user to print but not save a word form?
    ... You can remove the menu commands and keyboard shortcuts, ... and SaveAs commands by writing macros called FileSave and FileSaveAs ...
    (microsoft.public.word.docmanagement)
  • Re: How to prohibit saving a file in Word 97?
    ... >the user to be able to save the template on a disk, hard drive, etc. Can ... In that template, create macros named FileSave, FileSaveAs, and ... macros can be empty, or you can put in a MsgBox saying ... doesn't need to be saved before closing. ...
    (microsoft.public.word.docmanagement)
  • Re: Putting templates in a pulldown?
    ... >Under Commands, Categories select New Menu and then drag the New Menu ... >Select the tab and template and click Open (a document should now open based ... >Under Commands, Categories, click on Macros ... it just opens up the templates dialogue ...
    (microsoft.public.word.newusers)
  • Re: How to prohibit saving a file in Word 97?
    ... the answer is basically the same except that macros in documents ... Jay Freedman ... >>>I have a custom template in Word 97 that generates a word document. ... >> In that template, create macros named FileSave, FileSaveAs, and ...
    (microsoft.public.word.docmanagement)