View Single Post
  #1  
Old August 3rd 06, 11:48 PM posted to microsoft.public.outlook.program_vba
marie
external usenet poster
 
Posts: 2
Default a program is trying to access e-mail address - how do I avoid this

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

Ads