Hello,
I have the below code that work in the sense that it will pull the document and create an email. However it will not word merge before the email is created so all the info that normally would be filled in is missing. How do I get it to mail merge successfully and then copy the data to the email. My word templates do not have pictures but they do have color and formatting. I have read a few different post but I don't think they are in reference to the goal that I am aiming for. Any help is appreciated.
Private Sub Combo1141_Click()
Dim dbHR As DAO.Database
Dim rstMerg As DAO.Recordset
Dim wd As Object, editor As Object
Dim doc As Object
Dim oMail As MailItem
'ADD INFO TO MERGE TABLE
DoCmd.OpenQuery "Delete_Temp_Table"
Set dbsHR = CurrentDb
Set rstMerg = dbsHR.OpenRecordset("Temp_Table")
rstMerg.AddNew
rstMerg!Candidate_Name = Me.Candidate_Name
rstMerg!Tentative_Start_Date = Me.Tentative_Start_Date
rstMerg!Reporting_Manager = Me.Reporting_Manager
rstMerg.Update
'WORD DOCUMENT OPENING
Set wd = CreateObject("Word.Application")
Set doc = wd.Documents.Open("U:\Operations\Database\Mail Merg\First Day Details (Contractor).docx", ReadOnly)
doc.Content.Copy
doc.Close
Set wd = Nothing
'Email Opening and create
Set OutApp = CreateObject("Outlook.Application")
Set oMail = OutApp.CreateItem(0)
With oMail
.BodyFormat = olFormatRichText
.Display
Set editor = .GetInspector.WordEditor
editor.Content.Paste
End With
End Sub
Thank you again for any help
Kris C.