Solved

Deploying an Outlook custom toolbar for all Exchange users

Posted on 2009-03-31
4
892 Views
Last Modified: 2013-11-26
I am trying to deploy a custom toolbar in Outlook across the network.
I have a custom form, I have a macro called "MyHandler" that launches the form on all machines. I achieved this by copying the %AppData\Roaming\Microsoft\Outlook\VBAProject.OTA to all PC's.

All I need to do now is create a VB script to generate the toolbar and button to run the macro.
I have this script that I found whilst searching for the solution.
http://www.tech-archive.net/Archive/Office/microsoft.public.office.developer.vba/2007-06/msg00025.html
In case the link goes, I have pasted the code into the code box below.
When I run the script, It generates the "Open Custom Forms Bar" toolbar but it then errors on line 7.
I'm so close to completing this but I'm no good with VB. Can anyone suggest where the script is going wrong please? Thank you.
Dim oActExp
Dim cmdbar
Dim cmdbtn
Set olApp = CreateObject("Outlook.Application")
set oActExp = olApp.ActiveExplorer
Set cmdbar = oActExp.CommandBars.Add("Open Custom Forms Bar", 1)
set cmdbtn = oActExp.CommandBars("Open Form").Controls.Add(1)
With cmdbtn
.Caption = "Call Report"
.OnAction="MyHandler"
End With
cmdbar.Visible = True
cmdbtn.Visible = True
msgbox("Setup complete!")

Open in new window

0
Comment
Question by:belmonte
  • 2
4 Comments
 
LVL 76

Accepted Solution

by:
David Lee earned 500 total points
ID: 24033049
Hi, belmonte.

Change line 7 to

    set cmdbtn = cmdbar.Controls.Add(1)



0
 

Author Closing Comment

by:belmonte
ID: 31564907
Thats the one. Thank you BlueDevilFan.
Another issue I had with the script is the button did not do anything but I figured that one out myself. I had to change lin 10 from:
.OnAction="MyHandler"
to
.OnAction="Project1.ThisOutlookSession.MyHandler"
I guess Outlook didn't know where to find the macro :/

Thanks again. I hope this helps someone else in future.
0
 
LVL 76

Expert Comment

by:David Lee
ID: 24033408
You're welcome, belmonte.  Glad I could help.
0
 

Expert Comment

by:JAWC
ID: 34135414
Hi, I am working on something similair . Your help is very much appreciated .

I have changed line 7 to set cmdbtn = cmdbar.Controls.Add(1)

Renamed my form to test (instead of My Handler) then when I tried to run the script I ger an error in line 6,  char 1,  Error Object required.

Any thoughts?

Thanks
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …
Many of my clients call in with monstrous Gmail overloading issues with Outlook. A quick tip is to turn off the All Mail and Important folders from synching. Here is a quick video I made to show you how to turn off these and other folders in Gmail s…

839 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