NewOrderFac33
Well-known Member
- Joined
- Sep 26, 2011
- Messages
- 1,268
- Office Version
-
- 2016
- 2010
- Platform
-
- Windows
Good morning,
I am processing a list of entries in a database to generate an email.
The idea is that the string variable DLLBody will be generated in a For-Next loop and will contain a number of lines which will be inserted into the middle of the HTML email code. Each line is separated by two line breaks (to put a blank line between each entry).
If, after the For-Next loop I display the contents of DLLBody with MsgBox, the results are fine, but when DLLBody is carried through into the main body of the email, the line breaks are lost and the lines come through as one continuous string.
Probably dead obvious to anyone who knows HTML, but with less than a week's experience, I sadly don't fall into that category.
As usual, all assistance gratefully received.
Pete
I am processing a list of entries in a database to generate an email.
Rich (BB code):
DLLBody = ""
MyCount = 1
For Each MyCell In Sheets("Version3 DB").Range("V3_Col_DLLNames")
DLLBody = DLLBody & Format(MyCount, "000") & " DLL Name: " & MyCell.Value & ", Product: " & MyCell.Offset(0, 1).Value & ", Configuration Item: " & MyCell.Offset(0, 1).Value & vbNewLine & vbNewLine
MyCount = MyCount + 1
Next
StrBody = "<span style='font-size:12.0pt;font-family:Arial;color:black'><B><U>" & "Critical component DLL change" & " </B></U></span>"
StrBody = StrBody & "<HTML><BR> <BR> <BR> "
StrBody = StrBody & "<span style='font-size:10.0pt;font-family:Arial;color:black'>" & "Good morning," & "</span>"
StrBody = StrBody & "<BR><BR> "
StrBody = StrBody & "<span style='font-size:10.0pt;font-family:Arial;color:black'>" & "Please note that the latest version of the DLL Report reflects " & _
"changes to the following critical components:" & "</span>"
StrBody = StrBody & "<BR> <BR>"
'HERE'S WHERE DLLBODY IS INSERTED!
StrBody = StrBody & "<span style='font-size:10.0pt;font-family:Arial;color:green'>" & DLLBody & "</span>"
StrBody = StrBody & "<BR> <BR> <BR>"
StrBody = StrBody & "<span style='font-size:10.0pt;font-family:Arial;color:black'>" & "Please open the workbook at the following location:" & "</span>"
StrBody = StrBody & " <BR><BR>"
StrBody = StrBody & " <span style='font-size:10.0pt;font-family:Arial;color:black'><a href='file:///\\aragorn\teams\Development\Releases\Documentation\DLL Versions\Get Latest.xlsm'>" & _
"\\aragorn\teams\Development\Releases\Documentation\DLL Versions\Get Latest.xlsm</a>"
StrBody = StrBody & " <BR><BR>"
StrBody = StrBody & "<span style='font-size:10.0pt;font-family:Arial;color:black'>" & "and navigate to the Version3 DB tab." & "</span>"
StrBody = StrBody & " <BR><BR><BR><BR>"
StrBody = StrBody & "<span style='font-size:10.0pt;font-family:Arial;color:black'>" & "____________________________________" & "</span>"
StrBody = StrBody & "<BR>"
StrBody = StrBody & "<span style='font-size:14.0pt;font-family:Arial;color:green'>" & "Build & Release Team" & "</span> </HTML>"
The idea is that the string variable DLLBody will be generated in a For-Next loop and will contain a number of lines which will be inserted into the middle of the HTML email code. Each line is separated by two line breaks (to put a blank line between each entry).
If, after the For-Next loop I display the contents of DLLBody with MsgBox, the results are fine, but when DLLBody is carried through into the main body of the email, the line breaks are lost and the lines come through as one continuous string.
Probably dead obvious to anyone who knows HTML, but with less than a week's experience, I sadly don't fall into that category.
As usual, all assistance gratefully received.
Pete