Solved

Deploying an Outlook custom toolbar for all Exchange users

Posted on 2009-03-31
4
891 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

Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
MS Outlook is a world-class email client application that is mainly used for e-communication globally.  In this article, we will discuss the basic idea about MS Outlook, its advanced features, and types of MS Outlook File formats.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…

816 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

9 Experts available now in Live!

Get 1:1 Help Now