Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Feb 2001
    Location
    San Francisco, California, USA
    Posts
    67
    Thanks
    0
    Thanked 1 Time in 1 Post

    Macros unavailable in protected 2007 templates (Word 2007/VBA)

    Greetings, everyone.

    It seems that protecting a Word 2007 template renders its macros unavailable to documents based on the template.

    I created a Word 2007 template, added form fields and macros, protected the template (without password) and saved as a .dotm. Using the .dotm, I created a new document.

    I went to the Developer tab and clicked Macros (had to unprotect the document first). The attached template appeared in the “Macros In” dropdown, and my macros appeared in the Macros list.

    I re-protected the document, saved and closed it. I re-opened the document and looked at Developer/Macros again. The macros no longer appeared in the Macros list, and the template no longer appeared in the “Macros In” dropdown.

    To restore the macros, I had to close the document, and unprotect the template again.

    This happened regardless of whether the document itself was protected or unprotected.

    The obvious workaround is to remove the protection from the template. But then the documents created with the template wouldn’t be protected, and their form fields wouldn’t work. So we’ll also have to add code in the template to protect each new document as it’s created. Easy, but kind of silly, imho. <img src=/S/disappointed.gif border=0 alt=disappointed width=15 height=15>

    Has anyone else noticed this behavior?

  2. #2
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macros unavailable in protected 2007 templates (Word 2007/VBA)

    Excel 2007 shows the same (in my opinion wrong) behaviour.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  3. #3
    Star Lounger
    Join Date
    Feb 2001
    Location
    San Francisco, California, USA
    Posts
    67
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Macros unavailable in protected 2007 templates (Word 2007/VBA)

    Jan,

    Sorry to hear that! At least Microsoft is consistent. <img src=/S/crazy.gif border=0 alt=crazy width=15 height=15>

    I'm guessing it's an unexpected side effect of the new xml document format.

    Bob

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •