Suppress warning message in Outlook VBA email send

R

richardconers

I have Outlook XP. I have several email items in the draft folder. I
want VBA to send them (i.e., put them in the Outbox so that they can be
sent using send/receive under Tools (the Send/Receive under Tools can
be done manually).

However, when i use VBA code to send a draft email message such as

Dim nsMAPI As Outlook.NameSpace
Set nsMAPI = Outlook.GetNamespace("MAPI")

nsMAPI.Folders.Item(1).Folders.Item(12).Items(1).Send
dim Thing as mailitem
set Thing = nsMAPI.Folders.Item(1).Folders.Item(12).Items(1)
(this line works find; Item(12) is folder for draft emails)
the troublesome code line is
Thing.send

An outlook message pops up warning that a program is trying to send an
email, and asks whether I want to send it or cancel it. The warning
message takes about 5 seconds before giving me a chance to click "yes"
.. If I want to send out multiple emails this is a problem. Can I
suppress this message and have VBA automatically choose to send the
email?

Thank you!
 

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