I have this code which will reply All from a selected message in outlook and send an email to recipients from the ranges in excel.
however the Reply All will not CC the original recipients.
I am trying to do this with late binding.
How can I get this to work?
Sub SendToMailDirectly() '**************'Main event to compile email body Reply to all
Dim OutlookApp As Object
Dim Mess As Object
Dim omail As Object
Dim Recip As String
Dim oFSO
Dim oFS
If OutlookApp Is Nothing Then
Set OutlookApp = CreateObject("Outlook.Application")
Recip = Range("W2")
If OutlookApp.ActiveExplorer.Selection.Count Then
'If TypeOf Application.ActiveExplorer.Selection(1) Is Outlook.MailItem Then
Set Mess = OutlookApp.ActiveExplorer.Selection(1).ReplyAll
End If
End If
On Error Resume Next
With Mess
'.Subject = Range("E10")
.TO = Recip
.cc = Range("W3") & ";" & Range("W4")
.Display
End With
If Not Mess.Recipients.ResolveAll Then
For i = Mess.Recipients.Count To 1 Step -1
If Not Mess.Recipients(i).Resolved Then
'MsgBox Mess.Recipients(i).Name
Mess.Recipients.Remove (i)
Application.ScreenUpdating = False
End If
Next i
End If
End Sub
Bookmarks