• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1141
  • Last Modified:

Deploying an Outlook Macro to multiple users

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?
0
shanepresley
Asked:
shanepresley
  • 4
  • 3
2 Solutions
 
David LeeCommented:
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.
0
 
shanepresleyAuthor Commented:
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.

0
 
David LeeCommented:
"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?
0
Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

 
shanepresleyAuthor Commented:
Sorry for the delay, was away.

I used Tools | Customize, then dragged the macro to the place on the toolbar where I wanted it.  
0
 
David LeeCommented:
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()
    AddMyCustomMenu
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

0
 
shanepresleyAuthor Commented:
Thanks!  I have some followup questions, but you answered my original question so I'll close this and open a new one!  Thanks again...
0
 
David LeeCommented:
You're welcome.  Glad I could help.
0

Featured Post

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now