![]() |
|
#1
|
|||
|
|||
![]() For employees to work, I need to put some functionality into the Document_Open macro. I want to put this macro in a template (.dot) and place it on the network. Office 2007 is installed on most machines, and I'm testing on it. I create a document, insert the macro code, save it as a template (.dot). I use the following macro as a test: Code:
Sub Document_Open() MsgBox "ABC" End Sub |
#2
|
||||
|
||||
![]()
May be lost in translation.
Template should be saved as (.dotm). Document should be saved as (.docx). Which module is the Document_Open saved in?
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#3
|
|||
|
|||
![]()
Thank! In the TnisDocument module. Did you manage to repeat my situation? Did the macro work? If the template is .dot and the document .doc will not work?
|
#4
|
||||
|
||||
![]()
The code should work as long as the document created from the template can still see the template that contains the code. If the document is e.g. sent to a third party, then the document will no longer see the template and the code will not be available.
If you want the code to run when the document is created the macro should be Document_New
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#5
|
|||
|
|||
![]() Quote:
|
#6
|
||||
|
||||
![]()
Make the template trusted or put it in a trusted location and try again.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Convert Word 2007 macro to work in Word 2003 | Kamaflage | Word VBA | 1 | 02-25-2015 11:40 PM |
![]() |
esjayy | Word | 5 | 03-12-2014 06:59 PM |
![]() |
gayb63 | Word | 3 | 07-08-2012 10:48 AM |
![]() |
nnicko | Word | 2 | 04-16-2010 01:21 PM |
Annoying work in Word 2007 | CabbageTree | Word | 2 | 03-15-2010 01:47 PM |