Reply Outlook Email With Original body and Add new Body from Word

kevatarvind

Well-known Member
Joined
Mar 3, 2013
Messages
1,047
Office Version
  1. 365
Platform
  1. Windows
Hi All,

i have below code which works well to reply any email from my inbox and also take body from Word file but when it paste word content to outlook body it delete original body,

Please help i want original body as it is and add new body from word

VBA Code:
Option Explicit
Sub ReplyMail()
    Dim OutApp As Outlook.Application
    Dim OutMailEditor As Object
    Dim WordApp As Word.Application
    Dim Worddoc As Word.Document
    Dim sKillWord As String
    Dim sFilter As String, sSubject As String
            
    Set OutApp = CreateObject("Outlook.Application")
    Set WordApp = CreateObject("Word.Application")
            
            
    sSubject = ActiveCell.Value
    sFilter = "[Subject] = '" & sSubject & "'"
    
    With OutApp.Session.GetDefaultFolder(6).Items.Restrict(sFilter).Item(1).ReplyAll
            .Display
            .BodyFormat = olFormatHTML
            Set OutMailEditor = .GetInspector.WordEditor
            
            ' Open Word File and paste content to mail
            Set Worddoc = WordApp.Documents.Open(Filename:="C:\Users\Arvind\Desktop\EMAIL TESTING MACRO\TI_BODY.docx", ReadOnly:=True)
            Worddoc.Content.Copy
            OutMailEditor.Range.Paste
    End With
    Worddoc.Close
    sKillWord = "TASKKILL /F /IM Winword.exe"
    Shell sKillWord, vbHide
End Sub
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

Forum statistics

Threads
1,214,965
Messages
6,122,495
Members
449,088
Latest member
Melvetica

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