Hi,
I am writing code which creates an Outlook email, sets the importance level, fills in subject, body, etc.
The issue I have is when I programatically add recipients - I get a warning that states "A programs is trying to access e-mail addresses you have stored in Outlook. Do you want to allow this?"
I found code to disable this warning: OlSecurityManager.DisableOOMWarnings = True
BUT this code uses early binding (references). In order to avoid version issues, I want to use late binding.
Any ideas how to convert OlSecurityManager.DisableOOMWarnings = True to late binding?
Thanks
My entire function code is below:
--------------------------------------
Function fSetOutlookTask() As Boolean
'Set up the variables
Dim olApp As Object
Dim olMail As Object
Const olMailItem As Long = 0
Const olImportanceNormal As Long = 1
Const olImportanceHigh As Long = 2
Const olSave As Long = 0
Set olApp = CreateObject("Outlook.Application")
Set olMail = olApp.CreateItem(olMailItem)
With olMail
.Subject = "Subject"
.Importance = olImportanceHigh
.Recipients.Add "xxxx@hotmail.com"
''OlSecurityManager.DisableOOMWarnings = True
.Body = "BODY: " & vbNewLine & vbNewLine
.display
End With
'Cleanup
Set olMail = Nothing
Set olApp = Nothing
End Function
--------------------------------------
I am writing code which creates an Outlook email, sets the importance level, fills in subject, body, etc.
The issue I have is when I programatically add recipients - I get a warning that states "A programs is trying to access e-mail addresses you have stored in Outlook. Do you want to allow this?"
I found code to disable this warning: OlSecurityManager.DisableOOMWarnings = True
BUT this code uses early binding (references). In order to avoid version issues, I want to use late binding.
Any ideas how to convert OlSecurityManager.DisableOOMWarnings = True to late binding?
Thanks
My entire function code is below:
--------------------------------------
Function fSetOutlookTask() As Boolean
'Set up the variables
Dim olApp As Object
Dim olMail As Object
Const olMailItem As Long = 0
Const olImportanceNormal As Long = 1
Const olImportanceHigh As Long = 2
Const olSave As Long = 0
Set olApp = CreateObject("Outlook.Application")
Set olMail = olApp.CreateItem(olMailItem)
With olMail
.Subject = "Subject"
.Importance = olImportanceHigh
.Recipients.Add "xxxx@hotmail.com"
''OlSecurityManager.DisableOOMWarnings = True
.Body = "BODY: " & vbNewLine & vbNewLine
.display
End With
'Cleanup
Set olMail = Nothing
Set olApp = Nothing
End Function
--------------------------------------