Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-09-2012, 03:43 PM
macropod's Avatar
macropod macropod is offline Losing VBA codes in .dotm Windows 7 64bit Losing VBA codes in .dotm Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi tinfanide,

If you want the macro to fire when you create a new document from the template, you need a Document_New macro. All it needs to do is to call your Document_Open macro. However, as your template doesn't have a table, the macro will throw an error. That will also happen to the new document once it's been saved without a table. And, if you add a properly-formatted table to the template, you won't need the Document_New macro.

PS: You can attach dotm files, etc by converting them to zip archives first.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #2  
Old 04-09-2012, 07:43 PM
tinfanide tinfanide is offline Losing VBA codes in .dotm Windows 7 64bit Losing VBA codes in .dotm Office 2010 32bit
Expert
Losing VBA codes in .dotm
 
Join Date: Aug 2011
Posts: 312
tinfanide is on a distinguished road
Default

Well, thanks for the second point about converting files to zips.

But for the first point,
What I meant was

1. Create a .dotm file
2. Open the .dotm file (itself) (right-click the file, click "Open")
3. Go to VBE
4. Under the Project panel, in the TemplateProject section, enter some codes whatever
5. Save the .dotm file
6. Close the .dotm file
7. Open the .dotm file (itself) again (right-click the file, click "Open")
8. Go to VBE
9. The codes disappear

I don't know why the codes have disappeared.
Reply With Quote
Reply

Tags
dotm



Similar Threads
Thread Thread Starter Forum Replies Last Post
Losing VBA codes in .dotm New template/New normal.dotm kenglade Word 3 12-19-2011 04:00 PM
Losing VBA codes in .dotm How to get to normal.dotm Aiken_Bob Word 4 05-02-2011 02:41 PM
How to use .dotm template extension in MS Word? dude444 Word 0 09-20-2010 09:34 AM
template dotm unable to load in word 2003 dude444 Word 0 09-16-2010 02:13 PM
Losing VBA codes in .dotm Word 2007 crashes due to corrupt normal.dotm stevebond001 Word 1 05-11-2010 10:49 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:44 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft