?
Solved

Deploying an Outlook custom toolbar for all Exchange users

Posted on 2009-03-31
4
Medium Priority
?
903 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 76

Accepted Solution

by:
David Lee earned 2000 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Many people use more than one email account and so it becomes difficult for them to manage them when they use separate accounts,  so, in this article, I have shared an easy way to add Other Mail Accounts in your Google Inbox. It helps to combine all…
When you have clients or friends from around the world, it becomes a challenge to arrange a meeting or effectively manage your time. This is where Outlook's capability to show 2 time zones in one calendar comes in handy.
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…
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…
Suggested Courses

764 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