I have this code in outlook thisoutlooksession:
Public Sub hello2()
MsgBox "Hello world !!"
End Sub
I want to call this sub from vb.net with the following code. i made all the necessary reference to outlook and office:
Sub Main()
Dim olApp As New Outlook.Application
Dim olNs As Outlook.NameSpace
olNs = olApp.GetNamespace("MAPI")
Try
olApp.hello2()
Catch ex As Exception
Console.WriteLine(ex.ToString())
Finally
olApp = Nothing
olNs = Nothing
End Try
End Sub
however i keep getting Public member 'hello2' on type 'ApplicationClass' not found.
Can someone help?