Microsoft Office Forums

Go Back   Microsoft Office Forums > Microsoft Word > Word VBA

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 12-05-2011, 03:58 AM
tinfanide tinfanide is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: Aug 2011
Posts: 308
tinfanide is on a distinguished road
Default A newbie question: a must to save macro word file as .docm?

Is it a must to enable users to use a macro by saving the document as .docm? Can it be like saving it as a normal document file (.docx) and letting the users click a button to enable the attached macro?

Thanks in advance.
Reply With Quote
  #2  
Old 12-05-2011, 04:57 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 18,033
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

Hi tinfanide,

With the docx/docm format, only the docm form supports macros (the 'm' means macro-enabled). If you save such a document in the docx form, the macro will be deleted.

You could also save the document in the Word 97-2003 .doc format, if the later document format's features don't matter.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #3  
Old 12-05-2011, 06:18 AM
tinfanide tinfanide is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: Aug 2011
Posts: 308
tinfanide is on a distinguished road
Default

Oh, I see. So if I wanna write a macro for a user, they'll have to open the .docm file instead of a normal .docx one.
Reply With Quote
  #4  
Old 12-05-2011, 08:16 AM
Stefan Blom's Avatar
Stefan Blom Stefan Blom is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: Aug 2011
Posts: 2,943
Stefan Blom is a jewel in the roughStefan Blom is a jewel in the roughStefan Blom is a jewel in the rough
Default

Or you can store the macro in a macro-enabled template (*.dotm). If the template is Normal.dotm, the macro will be available to all documents; if the template is a document template, it will be available to all documents based on the template.
__________________
Stefan Blom
Microsoft Word MVP
Reply With Quote
  #5  
Old 12-06-2011, 05:17 AM
tinfanide tinfanide is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: Aug 2011
Posts: 308
tinfanide is on a distinguished road
Default

Yes, but after I've saved the dotm file, I open a new document (.docx). How can I use the macro stored in .dotm in .docx?
Reply With Quote
  #6  
Old 12-06-2011, 12:55 PM
Stefan Blom's Avatar
Stefan Blom Stefan Blom is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: Aug 2011
Posts: 2,943
Stefan Blom is a jewel in the roughStefan Blom is a jewel in the roughStefan Blom is a jewel in the rough
Default

If this is a custom template, you can attach it to the document in the Templates and Add-Ins dialog box. To display the dialog: On the Developer tab, click Document Template.

If the template is Normal.dotm, it will be globally available to all other documents in Word, as mentioned earlier.
__________________
Stefan Blom
Microsoft Word MVP
Reply With Quote
  #7  
Old 12-06-2011, 03:02 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 18,033
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

Quote:
Originally Posted by tinfanide View Post
Yes, but after I've saved the dotm file, I open a new document (.docx). How can I use the macro stored in .dotm in .docx?
In Word, the macros stored in a template are available to any document based on that template (provided they remain on the same system).
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
newbie question DanSandbergUCONN Word 5 03-06-2011 04:27 PM
Word Macro: Save file as text with current file name jabberwocky12 Word VBA 2 10-22-2010 12:23 PM
Macro will not save to normal.dot file when exiting bobbraun Word 1 09-28-2010 06:26 AM
Newbie to Powerpoint question Phil66 PowerPoint 9 06-01-2010 10:51 AM
Perhaps a newbie question I know but as1947 Excel 0 02-05-2009 08:01 AM


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


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
MSOfficeForums.com is not affiliated with Microsoft