Alan, you do not know how much I appreciate you looking at my code to see if
the security warnings can be eliminated. I REALLY need to get this working
and have spent hours (and hours) trying things, researching, and trying more
things, with no luck. THANK YOU.
The reason I need this-- I have several users who send 400+ emails a month
to customers with attachments. In order for their billing reconciliation to
match, they have to remember to send a copy of these emails WITHOUT the
attachments to the billing personnel who runs a reconciliation procedure to
match emails sent to customers against a database. If the user forgets to
send the email (they reply with different addressees so the attachments are
not sent), then it causes a reconciliation check, an email has to be sent to
the user asking for a copy of the email, the user has to send it and someone
tracks that it's received. My intent: after the user sends the email to
their customer, the rules wizard would automatically move the sent email
(based on words in the subject) to a folder, then the sub procedure would run
sending a reply to the appropriate billing people.
My code:
CODE IS IN “THISOUTLOOK SESSIONâ€
Option Explicit
Dim WithEvents ReplyToItItems As Items
Private Sub Application_Startup()
Dim ns As Outlook.NameSpace
Set ns = Application.GetNamespace("MAPI")
Set ReplyToItItems = ns.Folders.Item("Personal
Folders").Folders.Item("test").Items
End Sub
Sub ReplyToItItems_ItemAdd(ByVal Item As Object)
' when a new item is added to "test folder" it is processed
Dim myReply As MailItem
Set myReply = Item.Reply
With myReply
.To = "(e-mail address removed)"
.Send
End With
End Sub
Private Sub application_quit()
Dim ns As Outlook.NameSpace
Set ReplyToItItems = Nothing
Set ns = Nothing
End Sub
=======