I'm just wondering how to prevent (stop) a user from saving a document (just "Save", "Save As" is okay). I have a .docm that I'm using as a template, where the user just fills in three fields. I don't want them to accidentally fill it in, then save over the template.
I've seen a few SO threads that give code, but when I put the following in "ThisDocument" under "Microsoft Word Objects", nothing happens when I hit save:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
MsgBox ("Please 'Save As' instead.")
Debug.Print "Someone tried to save."
Cancel = True
End Sub
I'm expecting when I hit the save icon (or CTRL+S) the messagebox to pop up. ..that doesn't happen (nor does the debug.print
line work). What am I overlooking?
Related question: Should I just forget doing the above, and just create a true template document (.dotm)?