VBA to reply to all recipents in an email

ramkumarcn

Board Regular
Joined
Jun 21, 2011
Messages
114
Hi,

I am trying to reply all to an email using VBA. The following code only adds the To in the recipient list but it is not capturing the recipients CCd in the original email.
Also when the macro creates a reply email, it displays my email as 'From' by default. Instead I want the From to be 'someone@example.com". Please help with the code.

Sub Req_Not_Authorized()


Set objOL = CreateObject("Outlook.Application")
Set objMsg = objOL.ActiveInspector.CurrentItem
Set Reply = objMsg.ReplyAll
Set objAttachments = objMsg.Attachments
Reply.CC = "hpit.config.mgmt@hp.com"
For J = lngCount To 1 Step -1
AttachmentName = objAttachments.Item(J).Filename
Reply.Attachments.Add PACTIDFolder & "\" & AttachmentName
Next J
Reply.Display
End Sub

Regards,
Ram
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

Forum statistics

Threads
1,215,446
Messages
6,124,904
Members
449,194
Latest member
JayEggleton

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top