cancel
Showing results for 
Search instead for 
Did you mean: 

Outlook 365 - Print Message to pdf (HTML removing tags)

AaronIngram
Level 2
Hello,

I need to save the text of an email as a pdf for backup. This includes lines of text, and a data table.  I am using List Mail in Folder and Get Mail.  The HTML body is helpful for processing the data tables, but there does not seem to be a place where the email is read with spacing intact that I can use to make a .pdf.

##Sample Expected Output:
35148.png

I attempted to follow steps from the link below but creating the code step resulted in a compile error, and the Regex Replace did not retain the padding/spacing that the email would have created (the table ends up becoming an unreadable string).  I attempted the 'Save as file' but this converted to an .eml file.  Is there a way I can get from the 'Get email' to the outputted pdf of what the email looked like?

https://community.blueprism.com/communities/community-home/digestviewer/view-question?ContributedContentKey=76c2076c-e132-49ca-b5df-bc90c1f6397f&CommunityKey=3743dbaa-6766-4a4d-b7ed-9a98b6b1dd01

Thank you so much!
Aaron Ingram
1 REPLY 1

ewilson
Staff
Staff
Hi @Aaron Ingram,

There are a couple things you could try here. If you're able to do a 'Save As' on the email and save it to a .EML file, you could then try opening that file with Microsoft Word (assuming you have an instance of that on your Digital Worker). Form their you can print to PDF.

Alternatively, you can take the HTML of the body and save it to a local .HTML file and then open that with your browser of choice or Word and print it. However, in my test of this the format of the final document wasn't what I expected as any linked graphics, etc were not rendered correctly.

Cheers,
Eric​