I am working on a document that takes data from A userform field, converts it to HTML and sends the information in an email. I've got everything working really well using lots of help from this website and Ron deBruin's Email code.
The only niggly problem I have is if a particular field in the userform is left blank, then the email generated still has a blank line and I really want the line to be deleted and the lines below moved up one. An example is here:
25 Any Street
What I really want is:
25 Any Street
I've tried putting in a few IF statements to try and get round it but it keeps putting the blank line in because the only code I know how get a blank character is "". This obviously treats the line as blank but still a separate line. Here is the code I have so far.
StrBody = "<font size=""11px"" face=""Segoe UI"" color=""black"">" & "<br>" & _ "Dear " & frmCalc.txtSP1.Value & SP2 & SP3 & "," & "<br><br>" & _ " Some text " & frmCalc.DTPDate.Value & "." & "<br><br>" & _ 'this is the beginning of the address code "<b>Customer:</b><br>" & frmCalc.txtCust.Value & "<br><br>" & _ 'Customer in Bold & Customer Name from Form "<b>Address:</b><br>" & _ 'Address in Bold txtAdd1.Value & "<br>" & _ 'Address Line 1 from Form txtAdd2.Value & "<br>" & _ 'Address Line 2 from Form txtCity.Value & "<br>" & _ 'Address Line 3 from Form txtCounty.Value & "<br>" & _ 'Address Line 4 from Form frmCalc.txtPC1.Value & " " & frmCalc.txtPC2.Value & "<br>" 'Post Code from form
I can provide some more supporting code but I'm fairly sure this is where the changes need to be made.
Can anyone suggest a possible solution? This would sort out the same issue I have with a couple of other project I have as well so any helpful code would be most appreciated.
Many Thanks as always