Deploying an Outlook Macro to multiple users

Posted on 2009-04-30
Last Modified: 2012-05-06
I have a macro that I created for Outlook 2002.  I also added it to my File menu.

What options do I have for deploying it to the rest of our organization?  We have Active Directory and Group Policies, but our AD folks weren't familiar with Outlook macros or customization.  Is there a way to "push" out the macro, and ideally add it to the File menu?
Question by:shanepresley
    LVL 76

    Accepted Solution

    Hi, shanepresley.

    There is no way to push out an individual Outlook macro.  Here are the options you do have.

    1.  Create an Outlook add-in that performs the same action as the macro.  An add-in is a .dll that can be pushed to all machines.  Add-ins are written using the full version of VB or C.  They are more difficult to write than macros.

    2.  Push Outlook's code file.  Outlook stores all macro code in a single file (VbaProject.OTM).  You can push this file to all computers using a login script or an automated tool like Microsoft SMS.  However, since ALL Outlook macro code is in this file pushing it to all computers will overwrite the existing file.  Anyone who has developed any Outlook macros will lose their work when the file is overwritten.

    I'm not clear on what you mean when you say you added the macro to the file menu.
    LVL 1

    Author Comment

    Thanks.  Sounds like #2 might work for me, but I'll talk to our VB developers about #1.

    As for adding it to the file menu, I meant that I customized the File Menu in outlook, to add an item to launch the macro.  I suppose that's not possible to do on every desktop, simply by pushing out VbaProject.OTM.

    LVL 76

    Expert Comment

    by:David Lee
    "I suppose that's not possible to do on every desktop, simply by pushing out VbaProject.OTM."
    It might be possible.  How did you add a selection to the File menu?
    LVL 1

    Author Comment

    Sorry for the delay, was away.

    I used Tools | Customize, then dragged the macro to the place on the toolbar where I wanted it.  
    LVL 76

    Assisted Solution

    by:David Lee
    It's possible.  You'll need to add some additional code to create the toolbar button automatically.  Something like the code in the snippet.  This adds the button to an existing toolbar.  If you want to add your own toolbar and place a button on it, then the code will be slightly different.
    Private Sub Application_Startup()
    End Sub
    Private Sub AddMyCustomMenu()
        Dim ofcToolbar As Office.CommandBar, _
            ofcAddButton As Office.CommandBarPopup, _
            ofcBtn1 As Office.CommandBarButton
        Set ofcToolbar = Outlook.Application.ActiveExplorer.CommandBars("Menu Bar")
        On Error Resume Next
        Set ofcAddButton = ofcToolbar.Controls.Item("Your Button Name")
        If TypeName(ofcAddButton) = "Nothing" Then
            Set ofcAddButton = ofcToolbar.Controls.Add(msoControlPopup)
            With ofcAddButton
                .Caption = "Your Button Name"
                'First button on the menu'
                Set ofcBtn1 = ofcAddButton.Controls.Add(msoControlButton)
                With ofcBtn1
                    'Change the button caption on the next line'
                    .Caption = "Selection1"
                    'Change the action on the next line'
                    .OnAction = "Module1.MySelection1"
                End With
            End With
        End If
        On Error GoTo 0
        Set ofcToolbar = Nothing
        Set ofcAddButton = Nothing
        Set ofcBtn1 = Nothing
    End Sub

    Open in new window

    LVL 1

    Author Comment

    Thanks!  I have some followup questions, but you answered my original question so I'll close this and open a new one!  Thanks again...
    LVL 76

    Expert Comment

    by:David Lee
    You're welcome.  Glad I could help.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Create high volume marketing opportunities using email signatures with these top 10 DOs and DON'Ts of email signature marketing.
    Use email signature images to promote corporate certifications and industry awards.
    This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …
    This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now