PDA

View Full Version : Outlook custom toolbar



anilkumar
09-22-2008, 12:36 AM
Hi,
I am kind of new to VBA/Outlook coding, but I do have some general programming experience.
I am trying to (programmatically) create a custom toolbar with a custom button in. But I can't get the button's .OnAction event to fire. I am doing everything as it says in several tutorials/guides, but it just doesn't work.

I am using WindowsXP Pro / Office 2003

Here is the code for your reference,

Set btnNewCustom1 = _
tlbCustomBar1.Controls.Add(Type:=msoControlButton)

With btnNewCustom
.Style = msoButtonIconAndCaption
.Visible = True
.OnAction = "click"
End With

Function click()
MsgBox ("Message")
End Function

anilkumar
09-23-2008, 12:55 AM
Who knows the solution,Please post solution,

Thanks,

Slyboots
09-23-2008, 01:22 PM
You use the OnAction property to return or set the name of a VBA routine, such as "SlyBoots". Do you have a routine named "click"?

anilkumar
09-25-2008, 05:44 AM
Thanks for reply Sly. No, i don't have(but have a function, as shown in the example).Can you provide me a sample app for that.