set ToContact Outlook security workaround - help

A

Art Parra

I was forced to update my outlook 2000 and now my scheduled jobs fail
because Outlook thinks a virus is accessing the address book. My macro
looks something like this:

Set OLF = GetObject ("",
"Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(olFolderInbox)
Set olMailItem = OLF.Items.Add
with olMailItem
.Subject = "my subject"
Set ToContact = .Recipients.Add("(e-mail address removed)")
.Body = "text"
.Attachments.Add attachment
.Send
end With
Set ToContact = Nothing
Set olMailItem = Nothing
Set OLF = Nothing

The exact message I get from Outlook is:

A program is trying to access e-mail addresses you have stored in
Outlook. Do
you want to allow this?

If this is unexpected, it may be a virus and you should choose "No".

thanks,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top