Solved

Deploying an Outlook custom toolbar for all Exchange users

Posted on 2009-03-31
4
884 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
Comment Utility
Hi, belmonte.

Change line 7 to

    set cmdbtn = cmdbar.Controls.Add(1)



0
 

Author Closing Comment

by:belmonte
Comment Utility
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
Comment Utility
You're welcome, belmonte.  Glad I could help.
0
 

Expert Comment

by:JAWC
Comment Utility
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Use email signature images to promote corporate certifications and industry awards.
Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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: …

743 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

13 Experts available now in Live!

Get 1:1 Help Now