嘗試創建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)
似乎在這裏丟失了一個問題(?) – dummy