Results 1 to 8 of 8
  1. #1
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Kortrijk, Belgium
    Posts
    571
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Workgroup templates (Office 97/Win XP)

    Hello,

    I am preparing some workgroup templates with macros attached. I want to store them on a shared network drive with read-only access for the users and full read-write access for me (as the administrator of the workgroup templates). When users apply the templates and when the document is saved they are prompted with the question: do you want to save the attached template? How can I solve this? They shouldn't save it at all. Moreover they have no write access.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Workgroup templates (Office 97/Win XP)

    What happens if you put (a copy of) such a template in your User Templates folder and create a document based on it? Do you get prompted to save the template too?

  3. #3
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Kortrijk, Belgium
    Posts
    571
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Workgroup templates (Office 97/Win XP)

    Hi Hans

    Actually, to be honest, I work with a workgroup template (in the test phase) on a network drive where I have full read-write access. Because I've got prompted to save the template, I added a line in the code to automatically save the attached template.

    ActiveDocument.AttachedTemplate.Saved = True

    Now that I want other users to work with this template, I don't want them to have write access, but I am afraid that it will cause trouble (what will happen if they've got prompted with that question?). Maybe I should organise myself to test it, but I wondered if somebody from the forum had experience with this.
    If I put the template in my User Template (where I have full read-write access), I am prompted too to save the template. No difference.

  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: Workgroup templates (Office 97/Win XP)

    Templates sometimes are changed by code adjusting menus or toolbars, adding AutoText entries, or other subtle changes. If you can root out those things, it might be preferable to suppressing the dialog.

  5. #5
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Kortrijk, Belgium
    Posts
    571
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Workgroup templates (Office 97/Win XP)

    Maybe, I should be a little bit more explicit about the macros attached to the template. The template is designed to generate a protocol document for an experiment within an R&D environment. The macro has some functionality in the Document_New and Document_Open events to fire a dialog window which allows the user to fill in document related information, which is stored in an Excel spreadsheet and in the document properties (both general and custom). In addition, new protocol utilities are added to main commandbar of Word (a popup menu). As I understand from your reply, this new popup menu is causing the problem? Does that mean that to avoid Word from prompting to Save the attached template, I should add code like:

    Application.DisplayAlerts = False
    ActiveDocument.AttachedTemplate.Saved = False
    Application.DisplayAlerts = True

  6. #6
    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: Workgroup templates (Office 97/Win XP)

    If the CustomizationContext of the CommandBar changes is your workgroup template, try setting the "Temporary" property to True when creating the new bars and/or controls. I'm not sure this will avoid having to save, but it's worth a try.

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

    Re: Workgroup templates (Office 97/Win XP)

    <hr>new protocol utilities are added to main commandbar of Word (a popup menu)<hr>
    If you do this in VBA code every time a document based on that template is created or opened, then this makes the template "dirty", hence the Save question. I encountered the same problem enabling/disabling a commandbar button depending on a user's choice. I solved this problem by putting this in a "wrapper" Sub which also sets the Saved status:

    Public Sub EnableCommandbarButton(strBarName As String, strButtonName As String, blnEnable As Boolean)
    Dim ctrl As CommandbarControl
    Dim blnSaved As Boolean
    With ActiveDocument
    blnSaved = .AttachedTemplate.Saved 'Get the current Saved status
    For Each ctrl In .Commandbars(strBarName).Controls
    If ctrl.Caption = strButtonName Then
    ctrl.Enabled = blnEnable
    Exit For
    End If
    Next ctrl
    .AttachedTemplate.Saved = blnSaved 'Restore the original Saved status
    End With
    End Sub

  8. #8
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Kortrijk, Belgium
    Posts
    571
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Workgroup templates (Office 97/Win XP)

    Thanks a lot to all of you.
    Jan , hartstikke bedankt!!

Posting Permissions

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