【发布时间】:2019-11-07 01:47:57
【问题描述】:
我无法使用来自 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, Outlook.OlAttachmentType.olByValue, , HttpContext.Current.Session("fileName"))
memo.Display()
Catch ex As Exception
Debug.WriteLine(ex.Message)
End Try
End If
【问题讨论】:
标签: javascript asp.net vb.net outlook client-side