none
saving a macro in a word 2010 template RRS feed

  • Question

  • I am converting a Word 2003 template that contains macros to a Word 2010 template.

    I have made sure that the folder that I am saving it to is a Trusted Location.

    I have enabled macros and even turned off Protected View.

    I open the project in VBA and type in the password (it is password-protected).

    But when I save the document to a DOTM, the project disappears with out any error message or warning.

    Why?

    Surely I can save a macro to a DOTM?

    Hopefully, I am missing some simple setting somewhere.

    Can anybody please help?

    Tuesday, July 24, 2012 7:45 PM

Answers

  • Hi Cindy

    Thanks.

    I was wondering if the macro was damaged, but it is happening to all three of the templates that I am editing.

    Anyway, I found the answer.  I was double-clicking on the template to edit it.  That's a no-no.  You have to right-click Open to edit it.

    Just one of those gotchas...

    Thanks again for your quick response.

    Thursday, July 26, 2012 1:09 PM

All replies

  • Hi metadata

    It's possible that this document is damaged in some way that's causing it to "drop" the macro storage...

    In the VBA Editor, File menu, there are Export and Import commands. You can use these to "backup" all the modules, classes and forms in your template to pure text files.

    Then try saving the file as *.dotm and don't worry if the VBA section gets lost. Go back into the VBA editor and use File/Import to bring the code back in. (And try testing "Save" before you do it all, just to make sure it retains the code.)


    Cindy Meister, VSTO/Word MVP

    Wednesday, July 25, 2012 9:15 AM
    Moderator
  • Hi Cindy

    Thanks.

    I was wondering if the macro was damaged, but it is happening to all three of the templates that I am editing.

    Anyway, I found the answer.  I was double-clicking on the template to edit it.  That's a no-no.  You have to right-click Open to edit it.

    Just one of those gotchas...

    Thanks again for your quick response.

    Thursday, July 26, 2012 1:09 PM
  • Ah, yes, that would do it :-) Glad you were able to track it down!

    Cindy Meister, VSTO/Word MVP

    Thursday, July 26, 2012 1:51 PM
    Moderator