Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Deploying an Outlook custom toolbar for all Exchange users

Posted on 2009-03-31
4
Medium Priority
?
910 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 learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

The core idea of this article is to make you acquainted with the best way in which you can export Exchange mailbox to PST format.
With so many activities to perform, Exchange administrators are always busy in organizations. If everything, including Exchange Servers, Outlook clients, and Office 365 accounts work without any issues, they can sit and relax. But unfortunately, it…
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 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 …

597 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