M
marie
In my vba code I'm receiving the following error "a program is trying
to access e-mail addresses you have stored in outlook. Do you want to
allow this?..." I'm not accessing addresses at all so I don't know why
the error message is appearing. I've been able to isolate the error to
the final line of code below where I'm appending text - does anyone
know how I can avoid this msg from appearing??
Sub test()
Dim myOlApp As New Outlook.Application
'check if this is a mail object first
If myOlApp.ActiveInspector.CurrentItem.Class = olMail Then
myOlApp.ActiveInspector.CurrentItem.Subject = "test"
'append to email body
myOlApp.ActiveInspector.CurrentItem.Body =
myOlApp.ActiveInspector.CurrentItem.Body & " appending new text"
End If
End Sub
to access e-mail addresses you have stored in outlook. Do you want to
allow this?..." I'm not accessing addresses at all so I don't know why
the error message is appearing. I've been able to isolate the error to
the final line of code below where I'm appending text - does anyone
know how I can avoid this msg from appearing??
Sub test()
Dim myOlApp As New Outlook.Application
'check if this is a mail object first
If myOlApp.ActiveInspector.CurrentItem.Class = olMail Then
myOlApp.ActiveInspector.CurrentItem.Subject = "test"
'append to email body
myOlApp.ActiveInspector.CurrentItem.Body =
myOlApp.ActiveInspector.CurrentItem.Body & " appending new text"
End If
End Sub