What are the reserved names for macros?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

What do I call a macro so that it automatically runs when I close the
document? I have used AutoNew and AutoOpen in the past, so I presume that
there is a reserved name for a macro to run on close?
 
G'Day

Auto_Close or;
Private Sub Document_Close()
ThisDocument.Save
End Sub
in Excel
Workbook_BeforeClose

krakmup
 
AutoClose is the equivalent.

Auto macros do have their uses but they have been largely seperseded by
Events.

Open the ThisDocument module of your document (or template) ..
From the dropdown at the top left of the code window select Document
From the dropdown at the top right of the code window select Close

Put your code in the generated skeleton procedure.
 
Thanks, I am not really VBA "Compliant" as I record all my macros, I suppose
I will have to update that skill now!!!

Jane
 
Good Luck! It's well worth it!

--
Enjoy,
Tony


JaneH said:
Thanks, I am not really VBA "Compliant" as I record all my macros, I suppose
I will have to update that skill now!!!

Jane
 

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

Back
Top