Sub ReplyMSG()
'Graham Mayor -
Graham Mayor - Home Page - Last updated - 15 Jul 2023
Dim olItem As Outlook.MailItem
Dim olReply As MailItem ' Reply
Dim olInsp As Outlook.Inspector
Dim wdDoc As Object
Dim oRng As Object
On Error Resume Next
Select Case Outlook.Application.ActiveWindow.Class
Case olInspector
Set olItem = ActiveInspector.CurrentItem
Case olExplorer
Set olItem = Application.ActiveExplorer.Selection.Item(1)
End Select
If TypeName(ActiveExplorer.Selection.Item(1)) = "MailItem" Then
Set oMail = ActiveExplorer.Selection.Item(2)
Set olReply = olItem.ReplyAll
With olReply
.BodyFormat = olFormatHTML
Set olInsp = .GetInspector
Set wdDoc = olInsp.WordEditor
Set oRng = wdDoc.Range(0, 0)
oRng.Text = "Am currently working on your quote, I should have it done today or first tomorrow morning. " & _
"Any question, please feel free to email directly."
oRng.Collapse 0
oRng.Text = vbCr & vbCr & "Item 1" _
& vbCr & vbCr & "Item 2" _
& vbCr & vbCr & "Item 3"
olReply.Display
olReply.Send
End With
olItem.Categories = "Juan Cabrera”"
olItem.Close olSave
lbl_Exit:
Set olItem = Nothing
Set olReply = Nothing
Set olInsp = Nothing
Set wdDoc = Nothing
Set oRng = Nothing
Exit Sub
End Sub