我在outlook thislooklooksession中有这个代码:
Public Sub hello2()
MsgBox "Hello world !!"
End Sub
我想使用以下代码从vb.net调用此子。我对前景和办公室做了所有必要的参考:
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
然而,我继续获得公共成员' hello2'在类型' ApplicationClass'未找到。
有人可以帮忙吗?