Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

create menu button in outlook

Status
Not open for further replies.

swetham

Programmer
May 5, 2010
257
DE
I have created an outlook application and the code is,

Private WithEvents btn1 As Office.CommandBarButton
Private Sub ThisAddIn_Startup(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Startup

Dim explorer As Outlook.Explorer = Me.Application.ActiveExplorer()

If explorer IsNot Nothing Then

Dim bar As Office.CommandBar = explorer.CommandBars.Add("HOCHTIEF", Temporary:=True)

bar.Visible = True
btn1 = bar.Controls.Add(Office.MsoControlType.msoControlButton, Temporary:=True)

btn1.Caption = "HOCHTIEF"

btn1.Tag = "myOutlookAddin1.btn1"

btn1.Style = Office.MsoButtonStyle.msoButtonCaption

End If
End Sub

Private Sub Btn1_Click(ByVal ctrl As Office.CommandBarButton, ByRef cancelDefault As Boolean) Handles btn1.Click
msgbox ("Button clicked")
End Sub


Message box is getting displayed perfectly but if i want to run an exe in button click i am not able to write process.start() method. CAn anyone please help me out?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top