Thread: [Solved] Losing VBA codes in .dotm
View Single Post
 
Old 04-09-2012, 07:14 AM
tinfanide tinfanide is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: Aug 2011
Posts: 312
tinfanide is on a distinguished road
Default How do I save VBA codes in .dotm files?

Quote:
Originally Posted by tinfanide View Post
I've a dotm file and add some codes.
Since I cannot upload a dotm file here, I have attached it in
http://www.box.com/s/4b7c859d87c60f20c609


Code:
Private Sub Document_Open()
MsgBox "open"
End Sub
But it does not trigger the codes.

Source:
http://www.box.com/s/4b7c859d87c60f20c609

Please take a look at the demo of the problem:

Demo:
http://youtu.be/scWAD2-heKg


Well, I've found that
the codes written there are run when I open a .docx file.
By then, I know how it works.
It works for a normal document (.doc, .docx).
It does not work for a template (.dotm).

But another question comes:
How do I save VBA codes in .dotm files?
Reply With Quote