Click to See Complete Forum and Search --> : MS Outlook auto-reply
gje
Jul 3rd, 2002, 12:20 PM
I am writing an application that needs to read an email and then reply to the sender. Reading and writing are fine except I don't know how to reply. I can write a new email but I don't know the email address to write to, all I know is the sendername and therefore I can't write to them without knowing their address. Does anybody know how to get the senders' email address out of outlook or reply to a message with custom text?
Any information gratelfully received.
thanks.
Graham
GrahamErrington@uk.agcocorp.com
patrickfitzg
Jul 7th, 2002, 03:31 PM
Here is a snippet for automating outlook for the reply.
Don't know if you are precluded from doing this. If you are, you need to get to the MAPI layer - post back if still no joy.
Dim objOutlook As New Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
'Create new message
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
.To = "mymail@anymail.com"
.Subject = "My Reply Subject"
.Body = "Dear Customer" & vbNewLine & vbNewLine
.Body = .Body & "Here is my reply "
.Importance = olImportanceHigh
.Send
End With
Set objOutlookMsg = Nothing
Set objOutlook = Nothing
patrick.fitzgerald@ulpian.com
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.