【发布时间】:2015-10-13 13:30:38
【问题描述】:
当尝试创建 Outlook 实例时,UAC 阻止了此过程。我知道在 windows 7 上 UAC 可以更改,但 windows 8 不能完全删除。这就是我需要管理员权限的原因。
Try
' Get running outlook instance (if there is)
outlook = GetObject(Nothing, OUTLOOK_CLASS)
Catch ex As Exception
End Try
' No running instance? then create new instance of outlook
If IsNothing(outlook) = True Then
Try
outlook = CreateObject(OUTLOOK_CLASS)
Catch ex As Exception
End Try
End If
' Show error message if outlook is not installed
If IsNothing(outlook) = True Then
MsgBox(String.Format(My.Resources.ErrorEmailUnableToSend, vbCrLf, My.Settings.EmailNHD), MsgBoxStyle.Exclamation, My.Application.Info.Title)
Exit Try
End If
' Create the email message
email = outlook.CreateItem(mailItem)
【问题讨论】:
-
这里似乎遗漏了一个问题(?)