Dear Great Minds of Excel,
I have a spreadsheet that that I log business type contacts from. I can email from the spreadsheet to anyone of my contacts listed. I want to be able to place text in the outlook email but preserve the formatting. I can import the text from a word file by it I converted to text only with out formatting. I have the code below that allows the user to select the file and copy to a variable named MsgTxt. When outlook email is created the text does not include formatting.
Here is what worked without the formatting.
Thanks for any suggestions.
/s/
Craig
I have a spreadsheet that that I log business type contacts from. I can email from the spreadsheet to anyone of my contacts listed. I want to be able to place text in the outlook email but preserve the formatting. I can import the text from a word file by it I converted to text only with out formatting. I have the code below that allows the user to select the file and copy to a variable named MsgTxt. When outlook email is created the text does not include formatting.
Here is what worked without the formatting.
HTML:
'Dimension variables.
Dim OL As Object, MailSendItem As Object
Dim W As Object
Dim MsgTxt As String, SendFile As String
Dim ToRangeCounter As Variant
'Identifies Word file to send
SendFile = Application.GetOpenFilename(Title:="Select MS Word " & _
"file to mail, then click 'Open'", buttontext:="Send", _
MultiSelect:=False)
'Starts Word session
Set W = GetObject(SendFile)
'Pulls text from file for message body
MsgTxt = W.Range(Start:=W.Paragraphs(1).Range.Start, _
End:=W.Paragraphs(W.Paragraphs.Count).Range.End)
'Ends Word session
Thanks for any suggestions.
/s/
Craig