Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Feb 2003
    Location
    London, Gtr London
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to check global template is enabled before launching Word?


    Before launching MS Word, I want to check that a Global Template is available and enabled.

    I have a .NET program (C#) and I'd like it to check the status Global Template before attempting to launch MS Word, to avoid unhandled exceptions which definitely occur if the Global Template is not available or enabled.

    There seems to be a lot of information online for COM Add-Ins and checking the Registry for correct LoadBehavior and removal from applications' Resiliency\DisabledItems hives. That's great, and all of that can be checked before launching MS Word, for COM Add-Ins.

    I can check that my DOTM file is in my STARTUP folder. (e.g. C:\Program Files\Microsoft Office\Office12\STARTUP). But I've found nothing for checking that a Global Template is enabled. They are enabled if they appear checked in MS Word itself within Word Options | Add-Ins | Manage Templates | Go.

    But any ideas how to check whether a DOTM file is enabled prior to launching MS Word? Surely that's lurking out there somewhere in the Registry or something.

    Thanks for any ideas,
    Geoff


  2. #2
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    Willow Grove, Pennsylvania, USA
    Posts
    197
    Thanks
    4
    Thanked 46 Times in 38 Posts
    As long as the template is in the Startup folder, it will be enabled every time Word starts. The user can disable it for the current session by unchecking it in the Manage Templates dialog, but it will be re-enabled the next time Word starts. So checking that your template is in the Startup folder is sufficient.

  3. #3
    5 Star Lounger kmurdock's Avatar
    Join Date
    Feb 2003
    Location
    Pacific Grove, California, USA
    Posts
    668
    Thanks
    3
    Thanked 21 Times in 19 Posts
    Are you getting errors? While your global template will automatically be loaded and enabled when Word opens, a short bit of time can pass while Word completes its start up. If you try to access a routine in your global template before Word is done loading itself, you will probably receive an error that wouldn't happen a split second or two later.

    Kim

  4. #4
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    Willow Grove, Pennsylvania, USA
    Posts
    197
    Thanks
    4
    Thanked 46 Times in 38 Posts
    Quote Originally Posted by kmurdock View Post
    Are you getting errors? While your global template will automatically be loaded and enabled when Word opens, a short bit of time can pass while Word completes its start up. If you try to access a routine in your global template before Word is done loading itself, you will probably receive an error that wouldn't happen a split second or two later.
    If that is the problem, it can be solved with the OnTime function, as in http://www.word.mvps.org/FAQs/Userfo...xecUsertFm.htm

Tags for this Thread

Posting Permissions

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