I am automating the sending of emails with dynamic text and various formatting being applied to specific paragraphs of the email body.
The paragraphs are being added as follows
Whilst this looks unecessary, each of the defined ranges (cells) contain something like the following to achieve the paragraph specific formatting
<P STYLE='font-size:20'><b>Text here is formatted according to the container</b>
When the above is added to the .HTMLBody, I get the required formatting
At the end of the email between a sign off and a web address, I want to insert a logo/.jpg file
The logo is specified in the rngemail.Offset(0,22) Cell as
When this is added to the email
None of the vbNewLine commands work but a new paragprah is spaced at an acceptable space below the paragraph above
The image is added at the end of the preceding text
What I expected to see was
PARAGRAPH ABOVE LOGO
LOGO IMAGE HERE
but what I'm seeing is
PARAGRAPH ABOVE LOGO LOGO IMAGE HERE
I have no idea how to make this work as Excel just doesn't want to do what it is being told to do!
Any help with this would be hugely appreciated!
TIA
The paragraphs are being added as follows
VBA Code:
.HTMLBody = rngEmail.Offset(0, 3) & vbNewLine & vbNewLine & _
rngEmail.Offset(0, 4) & vbNewLine & vbNewLine & _
rngEmail.Offset(0, 5) & vbNewLine & vbNewLine & _
rngEmail.Offset(0, 6) & vbNewLine & vbNewLine & _
rngEmail.Offset(0, 7) & vbNewLine & vbNewLine & _
rngEmail.Offset(0, 8) & vbNewLine & vbNewLine & _
rngEmail.Offset(0, 9) & vbNewLine & vbNewLine & _
rngEmail.Offset(0, 10) & vbNewLine & vbNewLine & _
rngEmail.Offset(0, 11) & vbNewLine & vbNewLine & _
rngEmail.Offset(0, 12) & vbNewLine & vbNewLine & _
rngEmail.Offset(0, 13) & vbNewLine & vbNewLine & _
rngEmail.Offset(0, 14) & vbNewLine & vbNewLine & _
rngEmail.Offset(0, 15) & vbNewLine & vbNewLine & _
rngEmail.Offset(0, 16) & vbNewLine & vbNewLine & _
rngEmail.Offset(0, 17) & vbNewLine & vbNewLine & vbNewLine & _
rngEmail.Offset(0, 18) & vbNewLine & vbNewLine & _
rngEmail.Offset(0, 19) & vbNewLine & vbNewLine & vbNewLine & _
rngEmail.Offset(0, 20) & vbNewLine & vbNewLine & _
rngEmail.Offset(0, 21)
<P STYLE='font-size:20'><b>Text here is formatted according to the container</b>
When the above is added to the .HTMLBody, I get the required formatting
At the end of the email between a sign off and a web address, I want to insert a logo/.jpg file
The logo is specified in the rngemail.Offset(0,22) Cell as
<img src="https://business-my.sharepoint.com/personal/business_com/Documents/Documents/Folder 1/Folder 2/LogoFile.jpg"height=150> |
When this is added to the email
None of the vbNewLine commands work but a new paragprah is spaced at an acceptable space below the paragraph above
The image is added at the end of the preceding text
What I expected to see was
PARAGRAPH ABOVE LOGO
LOGO IMAGE HERE
but what I'm seeing is
PARAGRAPH ABOVE LOGO LOGO IMAGE HERE
I have no idea how to make this work as Excel just doesn't want to do what it is being told to do!
Any help with this would be hugely appreciated!
TIA