Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Jul 2006
    Posts
    38
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have developed a Word 2003 template which contains macros. I'm looking for a way to avoid getting the Security Warning dialog box which appears each time I use the template. I am aware I can set the Macro Security Setting to Low but don't want to do this for all docs, just for docs based on this particular template. In view of the fact that the template contains an AutoNew macro, is there a line of code I can Insert into this macro to suppress the display of the warning message? Any help would be gratefully accepted. Thanks.

    PS: Am having the same problem with a PowerPoint file - so same question for that too please!!

  2. #2
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts
    You don't ever want to keep macro security set to Low, as this will always allow macros to run without warning prompts. One scenario where this could be a bad thing is if you receive a document from an outside source that contains macros - you'd want to at least see a warning before any macros potentially run.

    You also can't suppress the warning from appearing, by putting a line of code in your template, because the macro warning is triggered by the template opening (when you open or create a new document based on a template, the first thing that happens is the template opens, in a hidden state) - so the warning would appear before any AutoNew code in your template could run.

    To get this working the way you want it, you need to do two things:

    (1) Set macro security to Medium: Go to Tools > Macro > Security, and set security level to Medium.

    (2) Put your template in a trusted location. The two practical options for versions of Word prior to Word 2007 is to use either the User templates or the Workgroup templates location. To see and set these locations, with any Word document open, go to Tools > Options, and click on the File Locations tab. You'll probably see a (truncated) file path next to User templates, and no path next to Workgroup templates.

    The User templates location is where Word stores Normal.dot. In Windows XP, this is typically located under: C:\Documents and Settings\<yourname>\Application Data\Microsoft\Templates
    The Workgroup templates location is blank by default, because this is a location you can set to be whatever you want.

    If your template is only for your use, or perhaps to be used by just a couple of people, it's OK to put them in the User templates location, but for any broader use than that, it's best to nominate and/or create a folder (that should be the same on every user's PC) to serve as the Workgroup templates location. You can also put your Workgroup templates location on a shared network directory.

    In any case, if you put your template in either of these two default trusted locations, then the macro warning will not be triggered (with macro security set to Medium).

    With regard to PowerPoint, you don't have a way to set things like template locations directly in PowerPoint. You can place PowerPoint templates in the default User templates location (which is the same as the User templates location for Word), or you can put them in the Workgroup templates location (that you have previously set from within Word).

    Hope that helps - let us know how it goes.

    Gary

  3. #3
    Lounger
    Join Date
    Jul 2006
    Posts
    38
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you very much. I had never realised before that the message would be suppressed if the template/doc was opened from the Templates folder(s). You learn something new every day

Posting Permissions

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