Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Jul 2008
    Location
    Suffolk, United Kingdom
    Posts
    308
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Installing macros to many users (2000 / 2003)

    Hi,

    I have made (with the help of woody's lounge!) a series of macros to do various things, open document, save, text logs etc. I also made a toolbar which includes a combobox and a text box then added buttons linking to the various macros.

    Is it possible to use a marco to install the entire toolbar with its button images and the macro codes etc so I can email out a file that on open will install the relevent items (this will save me going to over 150 seperate machines)

    I also need to be able to select the reference to Microsoft DAO 3.6 and Microsoft Outlook n.0 automatically if possible.

    Many thanks

    Kevin
    Regards
    Gerbil (AKA Kevin)

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

    Re: Installing macros to many users (2000 / 2003)

    Do the following in Word 2000:

    Create a document with the code, and save it as a template (.dot) in your Startup folder for Word - the File Locations tab of Tools | Options will tell you the location of this folder. By default it is

    Cocuments and Settings<username>Application DataMicrosoftWordStartup

    under Windows XP. Test whether the template is available as an add-in when you start Word.

    When everything works as intended, send the template to the users with instructions to install it in their Word startup folder. The references to DAO and Outlook will travel with the template, and they should update themselves automatically if the user has Word 2002 or 2003.

  3. #3
    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: Installing macros to many users (2000 / 2003)

    Sometimes I embed a MACROBUTTON in a document that users can double-click to copy the template to their Startup folders. I haven't reviewed this old code closely to see whether it contains any "rookie mistakes," so if you encounter problems applying it to your environment, please don't be too surprised.

    <code>Sub SaveInStartup()
    ' Get WordStartup location
    Dim strStartupFolder As String
    strStartupFolder = Options.DefaultFilePath(wdStartupPath)
    ' Check for location of current template
    If MacroContainer.Path = strStartupFolder Then
    MsgBox "It appears this template already is located in the Startup folder", vbExclamation + vbOKOnly
    Exit Sub
    End If
    ' Confirm user wants to save
    If MsgBox("Save this template in the Startup folder?", vbYesNo + vbQuestion) = vbNo Then Exit Sub
    Dim strNewPath As String
    strNewPath = strStartupFolder & "" & MacroContainer.Name
    ' Check for existing file
    If Dir(strNewPath) <> vbNullString Then
    If MsgBox("Replace existing file?", vbYesNo + vbQuestion) = vbNo Then Exit Sub
    End If
    Dim docNew As Document
    Set docNew = MacroContainer.OpenAsDocument
    docNew.SaveAs strStartupFolder & "" & MacroContainer.Name, wdFormatTemplate
    Set docNew = Nothing
    MsgBox "Done!", vbInformation + vbOKOnly
    End Sub</code>

  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: Installing macros to many users (2000 / 2003)

    More commonly,I have been using an installer (setup.exe file) to deploy templates. For examples of how to build an installer for a template with Inno Setup, see these posts: <post:=618,658>post 618,658</post:> and <post:=609,827>post 609,827</post:>.

  5. #5
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Denmark
    Posts
    347
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Installing macros to many users (2000 / 2003)

    Hi,

    Another approach could be to create a simple minimalistic - 'click me' like toolbar that as jscher states goes into the startup folder.
    Once clicked it adds a network located template as 'global'. In turn this triggers its 'autoexec' event and the 'click me' toolbar gets replaced with the 'large' version.

    In this way the template will:
    1. only load when actually needed
    2. be easy to update/distribute to all users at the same time, as there's only one centrally located file to replace


    'Click me'
    Public Sub MAIN()
    Dim MasterFile$
    Dim MasterFile_FullPath$

    If AddIns(MasterFile_FullPath).Installed = False Then
    AddIns.Add MasterFile_FullPath
    AddIns(MasterFile_FullPath).Installed = True
    End If

    End Sub

    Then in the network template you first run a 'Delete dummy toolbar' function, then a 'Create full version toolbar' function.
    Bests,
    RD


    PS: Wish there were a knob on the TV to turn up the intelligence. There's a knob called "brightness," but that doesn't work

Posting Permissions

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