Customize Document Main Menu Only in template

D

DA

Hi RAISA

You can create a set of routines that intercept things
like your save,saveAs and close.

For example:
----------------
Sub FileSaveAs()
MsgBox "You are trying to saveAs"
End Sub

Sub FileSave()
MsgBox "You are trying to save"
End Sub

Sub Document_Close()
MsgBox "You are trying to Close the doc"
End Sub
----------------

Hope that helps,
Dennis
-----Original Message-----
I work with MS word 2002 and Windows 2000. I need to
override all "Close", "Save" and "Save As" actions in the
document , BOT NOT IN THE TEMPLATE attached to the
document.
 
C

Chad DeMeyer

RAISA,

You would need to add something conditional to the Close routine like:

If Not ActiveDocument.Type = wdTypeTemplate Then
'your code here
End If

In the Save and SaveAs routines, you would add an Else clause:

If Not ActiveDocument.Type = wdTypeTemplate Then
'your code here
Else
'Save routine:
ActiveDocument.Save
'SaveAs routine
Dialogs(wdDialogFileSaveAs).Show
End If

Regards,
Chad


RAISA said:
Hi Dennis, thank you very much for the answer. But my question was about
how routins like "FileSave"... would distinct the template and the
document. How to make them execute ONLY ON THE DOCUMENT!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top