Forum Discussion

Mark Lee's avatar
Mark Lee
Copper Contributor
Sep 19, 2018
Solved

write a formatted email using excel macro

i have created a macro to edit a spreadsheet and i wish to add a step to create and edit an email. So far i have the following which works but is creating a paragraph space between the bottom two lin...
  • BobOrrell's avatar
    Sep 19, 2018

    If I'm not mistaken, you would like it displayed as a line of text, a double space, a line of text, a double space, a line of text, a double space, a bold line of text, and a line of text.  I noticed a lot of <p> tags in the body, which actually stands for Paragraph, so outlook is doing what you're telling it to do.  The last 2 sections also have the font size and family specified, and they're both the same, so those two lines will be Calibri / 11 regardless of what your default font is for outlook.  That being said, you can change the body line to this and I think it should correct your formatting.

     

    objOutlookMsg.HTMLBody = "<p>Please find attached a report detailing invoices in workflow which need completed within 1 day to avoid breaching the Department's 10 day Prompt Payment target.</p><p>For each payment that breaches this target an explanation is required from the Approving Officer on the monthly exception report.</p><p>I would be grateful if you could complete the required actions within the deadlines to help the Department improve its overall statistics.<b><p style=font-size:11pt;font-family:Calibri>Issued on behalf of DFI Financial Systems Branch</b><br>Email: FinancialSystems@infrastructure-ni.gov.uk</p>"

Resources