how to add a menu to the inserted own button?

M

Marc Waesche

Hi!

I use this script (see below) to add a button to the outlook inspector. Now
I want to open a sup menu when that button is pressed. How can I do that?

Best regards,
Marc



Private Sub Form_Load()

Dim oApp As Object
Dim objIns As Object
Dim objCBar As Object
Dim lpobjButton As Object

'CREATE AN INSTANCE OF THE OUTLOOK APPLICATION OBJECT
Set oApp = CreateObject("Outlook.Application")
'Set objIns = oApp.ActiveInspector
Set objIns = oApp.ActiveExplorer
Set objCBar = objIns.CommandBars

'CREATE THE ACTUAL BUTTON IN OUTLOOK
Set lpobjButton = objCBar.Item("Standard").Controls.Add()
lpobjButton.Caption = "SmilingMails"



'ENABLE THE BUTTON TO CALL ANOTHER EVENT
lpobjButton.HyperlinkType = 1

lpobjButton.ToolTipText = "SmilingMails"

Set lpobjButton = Nothing
Set oApp = Nothing

End
End Sub
 

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