Domski
Well-known Member
- Joined
- Jan 18, 2005
- Messages
- 7,292
Hi,
I've created a word form that has various buttons available depending on who opens it but now that I have saved it as a template I'm running into problems.
When the original word documnet was opened it had a "Private Sub Document_Open()" event procedure which displays an command button to e-mail the document or one to save and log the details in an Excel file depending on whether one of the members of my team opens the file or not.
Once saved and opened as a template I have had to change the procedure to a "Private Sub Document_New()" event procedure to sort the display of the buttons out which works fine but the problem that I have is that the code associated with the command buttons is not available in the new document and also additional code stored in modules are missing when the new document is created.
When I click on the command buttons in the new document I get an error: Run-time error '4248': This command is not available because no document is open.
I'm still a complete novice at Word VBA so any thoughts as to how I can get around this would be appreciated.
Dom
I've created a word form that has various buttons available depending on who opens it but now that I have saved it as a template I'm running into problems.
When the original word documnet was opened it had a "Private Sub Document_Open()" event procedure which displays an command button to e-mail the document or one to save and log the details in an Excel file depending on whether one of the members of my team opens the file or not.
Once saved and opened as a template I have had to change the procedure to a "Private Sub Document_New()" event procedure to sort the display of the buttons out which works fine but the problem that I have is that the code associated with the command buttons is not available in the new document and also additional code stored in modules are missing when the new document is created.
When I click on the command buttons in the new document I get an error: Run-time error '4248': This command is not available because no document is open.
I'm still a complete novice at Word VBA so any thoughts as to how I can get around this would be appreciated.
Dom