Results 1 to 10 of 10
  1. #1
    New Lounger
    Join Date
    Oct 2002
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Crash When Using Custom Templates (Word 2003 SP1)

    Some of my users are having an issue where documents created using a custom template will crash Word when they are reopened if Word is open but no documents are open. This does not happen if any other document is already open in Word and it does not happen if they double-click on a file in Windows Explorer to open it. The template relies on macros stored in another template that is located in the same folder. So far this is happening for about 10 out of 350+ users. All of their local settings seem to be correct (workgroup template locations, macros security settings, etc.). I'm at a loss for where to go from here. Anyone have any thoughts on where I should look?

    Thanks,
    -Steve

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Crash When Using Custom Templates (Word 2003 S

    I have to assume that there is a problem with the code in the template: it requires the presence of at least one document (e.g., a blank document) in order to do something. Do you have access to the code so that you could look at any AutoOpen or Document_Open procedures?

  3. #3
    New Lounger
    Join Date
    Oct 2002
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Crash When Using Custom Templates (Word 2003 S

    I wrote the template, so I have all the code. As far as I know there are no dependecies other than my global template. The global template is stored in the same folder as the other templates, not in the Startup folder. As part of troubleshooting, we tried moving the global to Startup but still had the same problem.

    The AutoOpen routine only does two things: displays the appropriate custom toolbar, and sets the AutoFormat options in case they've been set off our standard.

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Crash When Using Custom Templates (Word 2003 S

    What is the code to set the AutoFormat options and will it run if there is no document open? (It could be a timing problem...)

  5. #5
    New Lounger
    Join Date
    Oct 2002
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Crash When Using Custom Templates (Word 2003 S

    Here's the code you asked about. I call this routine in both the AutoNew and AutoOpen subs. Normally Tools | Options is disabled until a document is opened, so maybe that's it, but if so, I would think it would affect all systems, not just some. Also of note, noe of the users local to me have the problem. It's only people in other offices around the country. Even then, not all offices have the problem, and just because one person in the office has a problem doesn't mean they all do. This one really has me puzzled.

    Sub SetAutoFormatOptions()
    With Options
    .AutoFormatAsYouTypeApplyHeadings = False
    .AutoFormatAsYouTypeApplyBorders = False
    .AutoFormatAsYouTypeApplyBulletedLists = False
    .AutoFormatAsYouTypeApplyNumberedLists = False
    .AutoFormatAsYouTypeApplyTables = False
    .AutoFormatAsYouTypeReplaceQuotes = True
    .AutoFormatAsYouTypeReplaceSymbols = False
    .AutoFormatAsYouTypeReplaceOrdinals = False
    .AutoFormatAsYouTypeReplaceFractions = False
    .AutoFormatAsYouTypeReplacePlainTextEmphasis = False
    .AutoFormatAsYouTypeReplaceHyperlinks = False
    .AutoFormatAsYouTypeFormatListItemBeginning = False
    .AutoFormatAsYouTypeDefineStyles = False
    End With
    End Sub

  6. #6
    New Lounger
    Join Date
    Oct 2002
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Crash When Using Custom Templates (Word 2003 S

    Oops. Of course I meant Tools | Autocorrect, not Tools | Options since that's where the stuff I'm doing is set.

  7. #7
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Crash When Using Custom Templates (Word 2003 S

    That runs without objection when no documents are open, so perhaps it is something in the external template?

    (Note: I tested in Word 2002, not Word 2003)

  8. #8
    4 Star Lounger
    Join Date
    Dec 2003
    Location
    Zoetermeer, Zuid-Holland, Netherlands
    Posts
    559
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Crash When Using Custom Templates (Word 2003 S

    It could have something to do with using ActiveDocument in your code, before there's a doc visible. See the tread starting with <post#=407937.>post 407937.</post#>

  9. #9
    New Lounger
    Join Date
    Oct 2002
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Crash When Using Custom Templates (Word 2003 S

    I did a little remote control diagnostic session on one of the PCs having the problem. When I checked the project references in the VBA editor, my global template was listed as missing even though it does exist. If I redo the reference, it seems to work fine. Now the question is why does Word think the reference is missing and what can I do to prevent that? I'm using the same folder structure on each PC to store the templates. In fact, the template versions are checked in the login script and new templates downloaded automatically, so I know they're all in the right place.

  10. #10
    New Lounger
    Join Date
    Oct 2002
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Crash When Using Custom Templates (Word 2003 S

    For anyone interested, this oddity seems to have been caused by something in the user profile on the workstation. Resetting user profiles by keeping only My Documents, Favorites and Desktop seems to have fixed the problem. Still no idea why it happened, but at least we have a fix.

Posting Permissions

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