我无法打开Web服务器中带有附件的Outlook应用程序(客户端)。这是我的代码。有什么建议吗?
Dim app As microsoft.Office.Interop.Outlook.Application
Dim appNameSpace As microsoft.Office.Interop.Outlook._NameSpace
Dim memo As microsoft.Office.Interop.Outlook.MailItem
Dim processes = System.Diagnostics.Process.GetProcessesByName("OUTLOOK")
Dim collCount As Integer = processes.Length
If collCount > 0 Then
app = Marshal.GetactiveObject("Outlook.Application")
memo = app.CreateItem(microsoft.Office.Interop.Outlook.OlItemType.olMailItem)
memo.Attachments.Add(Report,Outlook.OlAttachmentType.olByValue,HttpContext.Current.Session("fileName"))
memo.Display()
Else
Try
app = New microsoft.Office.Interop.Outlook.Application
appNameSpace = app.GetNamespace("MAPI")
Process.Start("OUTLOOK")
memo = app.CreateItem(microsoft.Office.Interop.Outlook.OlItemType.olMailItem)
memo.Attachments.Add(Report,HttpContext.Current.Session("fileName"))
memo.Display()
Catch ex As Exception
Debug.WriteLine(ex.Message)
End Try
End If