Results 1 to 6 of 6
  1. #1
    New Lounger
    Join Date
    Feb 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Locking Macro Codes in Word 2010 Templates

    Hello:

    Is anyone in the Windows Secrets Lounge familiar with how to lock macro codes in Word 2010 templates?

    Regards,

    JanetteS


  2. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    3,820
    Thanks
    0
    Thanked 167 Times in 154 Posts
    Probably, but you'll have to tell us what you mean. Do you want to:
    • Prevent people from running certain macros?
    • Prevent people from editing macros?
    • Something else?
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  4. #3
    New Lounger
    Join Date
    Feb 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Good morning:

    All of our corporate templates contain macros that are accessed by pressing Ctrl+A and updated by pressing the F9 key and entering the document details (Document Title, Document Id., Document Version, Effective Date, job title of the Document Owner, and Update Table of Contents) in the update boxes. Users must press Ctrl+A and the F9 key in the Header section to pull the document’s details entered on the cover page into the header. The problem is that users, being unfamiliar with macros, tend to manually enter their document details in the macro fields without using the update boxes, which ruins the macros.

    We are trying to make the templates more user friendly. If there is a way to make it apparent to users that certain areas of the template contain macros, that would also be very helpful.

    If you have any suggestions, please let me know.

    Thanks,

    JanetteS

  5. #4
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,466
    Thanks
    3
    Thanked 130 Times in 123 Posts
    Janette

    It sounds like you are not using macros to do this but fill-in or ask fields.

    My suggestion is to convert over to using Content Controls which allow the users to edit the text directly on the page which automatically changes the document metadata and other instances (such as in the header). Content Controls were introduced in Word 2007 so they will be lost if the files are saved in doc format or edited in Word 2003 or earlier.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  6. #5
    Silver Lounger Charles Kenyon's Avatar
    Join Date
    Jan 2001
    Location
    Madison, Wisconsin, Wisconsin, USA
    Posts
    1,664
    Thanks
    47
    Thanked 59 Times in 57 Posts
    I agree that this sounds like Fields rather than macros. You can turn on display of fields to show all the time if you want. This is by-user, though, not something that can be put in your forms.

    I am assuming that your users are not opening the templates but creating new documents based on the templates. That is the primary way of protecting templates from inadvertent alteration and is how templates are expected to be used.
    Templates in Microsoft Word

    I also join Andrew in urging you to look into Content Controls. For ways of using an answer in one place to place the same information elsewhere, see Repeating Data.. One advantage of Content Controls over ASK or Fill-In Fields is that if you make an error in data entry it is relatively easy to correct. A series of ASK fields can be quite annoying.

    Take a look at the FAX cover sheet (professional design) you can see by searching Office.com in File > New for "fax." It uses Content Controls. (I think all of the fax templates on the site use Content Controls.)

    If you are not going with Content Controls - at least look into MacroButton Fields (no macros required) as prompts. Such prompts can be made bold and in different colors or fonts to make them stand out. Once they are used, they are gone. The Elegant Fax cover sheet uses a macrobutton field for a prompt for company name if you want to look at that.
    Last edited by Charles Kenyon; 2014-02-05 at 17:00.
    Charles Kyle Kenyon
    Madison, Wisconsin

  7. #6
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    3,820
    Thanks
    0
    Thanked 167 Times in 154 Posts
    Hi Janette,

    As Andrew says, these codes are not macros, but field codes. I'd suggest using Text Content Controls for the document details (Document Title, Document Id., Document Version, Effective Date, Job Title of the Document Owner). You can set the 'cannot be deleted' property of each of the Content Controls used of each of these items. For the Table of Contents, you can use Word 2010's 'Editing Restrictions' to prevent people editing it, but that makes updating the table of Content unduly difficult; I'd suggest recommending to users that they use Word's 'Filed Shading>Always' option to remind them where fields are that they shouldn't overtype. This will help protect cross-references and other fields too.

    As for replicating data in the header, I'd suggest creating and using a unique character Style for each of the elements you want to appear there. The character Style doesn't need to have any special attributes. You then apply that Style to the relevant Content Control's range and use a STYLEREF field in the header to reference the Style. Using STYLEREF fields this way has the advantage of not requiring anyone to access the header, as the updates occur dynamically as the document body content is updated.

    See attached demo. The STYLEREF fields in the header are embedded in IF fields to suppress their output until some meaningful content is input into the content controls.
    Attached Files Attached Files
    Cheers,

    Paul Edstein
    [MS MVP - Word]

Posting Permissions

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