Visio Guy

Visio Discussions => Programming & Code => Topic started by: litchick10 on November 28, 2017, 08:16:16 PM

Title: Sub for Document_BeforeSave not working
Post by: litchick10 on November 28, 2017, 08:16:16 PM
I've created the following Sub in Visio but when I hit the save icon or use the file-->save option, no message box is popping up.

Private Sub Document_BeforeSave(ByVal doc As IVDocument)
MsgBox ("Hello World")
End Sub

When I try to do a test run the macros window pops up and asks me to choose a macro. I cannot figure out what I'm doing wrong. Any assistance would be appreciated. I've tried running from modules and the ThisDocument code

I am running Visio 2013 Professional using .vsdm file type. I have Enabled Content and Trusted the document. 
Title: Re: Sub for Document_BeforeSave not working
Post by: Yacine on November 28, 2017, 08:56:02 PM
Is the sub in the ThisDocument module or did you create a new one?