Home

Email in VBA : Line Spacing in Un-Ordered List Issue

%3CLINGO-SUB%20id%3D%22lingo-sub-875298%22%20slang%3D%22en-US%22%3EEmail%20in%20VBA%20%3A%20Line%20Spacing%20in%20Un-Ordered%20List%20Issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-875298%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20a%20macro%20that%20builds%20an%20email%20(in%20a%20loop)%20Example%20Below.%20When%20the%20email%20is%20created%2C%20there%20is%20a%20blank%20line%20between%20the%20heading%20and%20the%20un-ordered%20lists%20that%20are%20created%20in%20the%20email.%20I%20would%20like%20to%20find%20the%20code%20that%20would%20remove%20that%20line%20or%20select%20all%20the%20text%20and%20choose%20this%20option%20(see%20red%20box%20in%20photo)%20in%20the%20%22paragraph%22%20section%20of%20an%20outlook%20email.%20Thank%20you!%20%5Bcode%20below%20picture%5D%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20404px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F133517iF058EDD235C369E3%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image.png%22%20title%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20468px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F133521i69D0B94C6683AC60%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image.png%22%20title%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESet%20obApp%20%3D%20Outlook.Application%3CBR%20%2F%3ESet%20NewMail%20%3D%20obApp.CreateItem(olMailItem)%3C%2FP%3E%3CP%3EWith%20NewMail%3CBR%20%2F%3E.Subject%20%3D%20Subject%3CBR%20%2F%3E.To%20%3D%20Toperson%3CBR%20%2F%3E.CC%20%3D%20CCperson%3CBR%20%2F%3E.BCC%20%3D%20BCCperson%3CBR%20%2F%3E.HTMLBody%20%3D%20%22%22%20%26amp%3B%20%22FIRST%20SET%20OF%20TEXT%22%20%26amp%3B%20%22%3CBR%20%2F%3E%22%20%26amp%3B%20%22%3CBR%20%2F%3E%22%20%26amp%3B%20_%3CBR%20%2F%3E%22Please%20note%20the%20following%3A%20%22%20%26amp%3B%20_%3CBR%20%2F%3E%22%3CUL%3E%22%20%26amp%3B%20%22%3CLI%3E%22%20%26amp%3B%20%22LIST%20ITEM%201%22%3C%2FLI%3E%22%20%26amp%3B%20_%3CBR%20%2F%3E%22%3CLI%3E%22%20%26amp%3B%20%22LIST%20ITEM%202%22%3C%2FLI%3E%22%20%26amp%3B%20%22%3CBR%20%2F%3E%22%20%26amp%3B%20_%3CBR%20%2F%3E%22Additional%20Notes%3A%20%22%20%26amp%3B%20_%3CBR%20%2F%3E%22%3CUL%3E%22%20%26amp%3B%20%22%3CLI%3E%22%20%26amp%3B%20%22LIST%20ITEM%201%22%3C%2FLI%3E%22%20%26amp%3B%20_%3CBR%20%2F%3E%22%3CLI%3E%22%20%26amp%3B%20%22LIST%20ITEM%202%22%3C%2FLI%3E%22%20%26amp%3B%20_%3CBR%20%2F%3E%22%3CLI%3E%22%20%26amp%3B%20%22LIST%20ITEM%203%22%3C%2FLI%3E%22%20%26amp%3B%20%22%3C%2FUL%3E%22%20%26amp%3B%20_%3CBR%20%2F%3E%22Thanks%2C%20%22%20%26amp%3B%20_%3CBR%20%2F%3E%22%22%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E.Attachments.Add%20XlsAttach1%3CBR%20%2F%3E.Attachments.Add%20XlsAttach2%3CBR%20%2F%3E.Display%3CBR%20%2F%3E%3CBR%20%2F%3EEnd%20With%3C%2FUL%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-875298%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EHTML%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-875405%22%20slang%3D%22en-US%22%3ERe%3A%20Email%20in%20VBA%20%3A%20Line%20Spacing%20in%20Un-Ordered%20List%20Issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-875405%22%20slang%3D%22en-US%22%3E%3CP%3E%22%3CLI%20style%3D%22%26quot%3B%26quot%3BMargin%3A%22%200%3D%22%22%3E%22%20for%20the%20un%20ordered%20list%20item%20solved%20my%20issue.%3C%2FLI%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Baker1050
New Contributor

I have a macro that builds an email (in a loop) Example Below. When the email is created, there is a blank line between the heading and the un-ordered lists that are created in the email. I would like to find the code that would remove that line or select all the text and choose this option (see red box in photo) in the "paragraph" section of an outlook email. Thank you! [code below picture]

 

image.pngimage.png

 

Set obApp = Outlook.Application
Set NewMail = obApp.CreateItem(olMailItem)

With NewMail
.Subject = Subject
.To = Toperson
.CC = CCperson
.BCC = BCCperson
.HTMLBody = "<BODY style=font-size:11pt;font-family:Calibri>" & "FIRST SET OF TEXT" & "<br>" & "<br>" & _
"Please note the following: " & _
"<ul>" & "<li>" & "LIST ITEM 1"</li>" & _
"<li>" & "LIST ITEM 2"</li>" & "<br>" & _
"Additional Notes: " & _
"<ul>" & "<li>" & "LIST ITEM 1"</li>" & _
"<li>" & "LIST ITEM 2"</li>" & _
"<li>" & "LIST ITEM 3"</li>" & "</ul>" & _
"Thanks, " & _
"</BODY>"


.Attachments.Add XlsAttach1
.Attachments.Add XlsAttach2
.Display

End With

1 Reply
Highlighted

"<li style=""Margin: 0;"">" for the un ordered list item solved my issue.