VBA UserForm macro

K

Keith Kowalski

I have created a Userform and a macro that opens the userform.

To get this working on other pc's we are just copying the .OTM file
(project).
This does work great, however, what I am looking for is a way to
programatically add a button on the toolbar that will launch the macro,
which in turn will show the userform. I need the button to only be visible
when a user opens a message not when all messages are displayed in the
Inbox.

Any help would be greatly appreciated.

Thank you,
Keith
 
G

Guest

You'd need to instantiate a public Inspectors collection variable using With
Events in the ThisOutlookSession module. This will give you access to the
NewInspector event, which will get called every time an item is opened in
Outlook. You can then use the Inspector object derived from that event to
add buttons or toolbars via the Inspector.CommandBars property.

See these links for more info and examples:

Items Command Bar:
http://www.microeye.com/resources/itemsCB.htm

Slovak Technical Services Code Samples:
http://www.slovaktech.com/code_samples.htm#InspectorWrapper
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top