reply by macro - OUTLOOK 2003

  • Thread starter Thread starter fitful_thought
  • Start date Start date
F

fitful_thought

In Outlook 2003 I would like to make a little macro that will send a message
saying thank you as a reply to the current mail message that is open in the
in box.

I tried this, but it doesn't work.

Sub tester()

With Current.MailItem
.Reply
.Body = "Thank you"
End With

End Sub


If anyone can help, I'd be most grateful.


thanks,
DL
 
What's you're missing is the current item -- it's
Application.ActiveInspector.CurrentItem. If you add an Option Explicit
statement to your module's Declarations section, you'll get warning messages
when you try to use expressions like Current.MailItem that don't represent
anything.

Try:

Set objInsp = Application.ActiveInspector
If Not objInsp Is Nothing Then
Set objItem = objInsp.CurrentItem
If objItem.Class = olMail Then
Set objReply = objItem.Reply
' your code to work with objReply goes here
End IF
End IF
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Back
Top