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
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