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?
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?