Reply macro...

F

fatchedecon

Hello everybody,

I need some help with VBA in Outlook 2003.
I need a macro to do the following :
When a message is selected: the macro open a new message replying to
the original sender, add a recipient in copy ([email protected]),
displaying a custom body text : "Hello, we've received you message."
and add the original message in attachment.

Thank you for your help...
 
M

Michael Bauer

Am 31 May 2006 14:00:43 -0700 schrieb (e-mail address removed):

You could try something like this. Please note that it is subject to
security issues.

Public Sub Sample()
Dim Reply As Outlook.MailItem
Dim Original As Outlook.MailItem

Set Original = Application.ActiveExplorer.Selection(1)
Set Reply = Original.Reply
Reply.Recipients.Add "(e-mail address removed)"
Reply.Recipients.ResolveAll
Reply.Attachments.Add Original
Reply.Body = "Some text"
Reply.Display
End Sub
 
F

fatchedecon

great... it works !

Can you give me a last tip : is it possible to add the recipient
"(e-mail address removed)" in copy (not recipient) of the message ?

thanks for your help...

;)


Michael Bauer a écrit :
 
M

Michael Bauer

Am 1 Jun 2006 07:31:31 -0700 schrieb (e-mail address removed):

Do you mean CC? The Recipients.Add returns a Recipient object. Please use
that and set its Type property =olCC.
 
F

fatchedecon

Thanks a lot...

i've just modified the code :

Public Sub Reply_Withcc()
Dim Reply As Outlook.MailItem
Dim Original As Outlook.MailItem
Set Original = Application.ActiveExplorer.Selection(1)
Set Reply = Original.Reply
With Reply
Set MyCC = .Recipients.Add("(e-mail address removed)")
MyCC.Type = olCC
Reply.Recipients.ResolveAll
Reply.Attachments.Add Original
Reply.Body = "Your demand is in progress..."
Reply.Display
End With
End Sub

It works great...

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