I created a button that takes selected table, copies and pastes it into an email between a note & my HTML signature.
Here is the code that was working yesterday but isn't today. ????
Sub Mail_Outlook_With_Signature_Html_1()
Dim outlook As Object
Dim newEmail As Object
Dim xInspect As Object
Dim pageEditor As Object
Dim strbody As String
Set outlook = CreateObject("Outlook.Application")
Set newEmail = outlook.CreateItem(0)
strbody = "Bonjour," & _
"<br><br>SVP, voir ci-dessous pour l'information <br>" & _
"<br><br>Merci! <br>" & _
"<br><br>MJ<br>"
With newEmail
.To = ""
.CC = ""
.BCC = ""
.Subject = "Information
Set xInspect = newEmail.GetInspector
Set pageEditor = xInspect.WordEditor
Selection.Copy
pageEditor.Application.Selection.End = pageEditor.Application.Selection.Start
pageEditor.Application.Selection.PasteAndFormat (wdFormatPlainText)
pageEditor.Application.Selection.Start = Len(.HTMLBody)
.display
.HTMLBody = strbody & "<br>" & .HTMLBody
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
Thoughts?
Here is the code that was working yesterday but isn't today. ????
Sub Mail_Outlook_With_Signature_Html_1()
Dim outlook As Object
Dim newEmail As Object
Dim xInspect As Object
Dim pageEditor As Object
Dim strbody As String
Set outlook = CreateObject("Outlook.Application")
Set newEmail = outlook.CreateItem(0)
strbody = "Bonjour," & _
"<br><br>SVP, voir ci-dessous pour l'information <br>" & _
"<br><br>Merci! <br>" & _
"<br><br>MJ<br>"
With newEmail
.To = ""
.CC = ""
.BCC = ""
.Subject = "Information
Set xInspect = newEmail.GetInspector
Set pageEditor = xInspect.WordEditor
Selection.Copy
pageEditor.Application.Selection.End = pageEditor.Application.Selection.Start
pageEditor.Application.Selection.PasteAndFormat (wdFormatPlainText)
pageEditor.Application.Selection.Start = Len(.HTMLBody)
.display
.HTMLBody = strbody & "<br>" & .HTMLBody
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
Thoughts?