WINAIRMVS
asked on
Run macro when visio closes
I need to run a macro when closing visio, and I can't seem to find the appropriate documentation to get me there. Any help would be appreciated.
If you are working with a specific file, you can add a "Before Document Close" event.
Enter the VBA editor, find the "This document" section in the project explorer, and select the BeforeDocumentClose event in the dropdown to the far right.
Enter the VBA editor, find the "This document" section in the project explorer, and select the BeforeDocumentClose event in the dropdown to the far right.
ASKER
I added the code to "This Document" which did not act on the closing of the document.
Private Sub BeforeDocumentClose()
nameofmacroIwanttorun
end
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Answer was what I needed. There was some extra code that wasn't necessary for what I was looking for, but otherwise great answer!
http://msdn.microsoft.com/en-us/library/ms427232.aspx