<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic RE: C# or .NET code to print .msg files to PDF  with images in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/C-or-NET-code-to-print-msg-files-to-PDF-with-images/m-p/48555#M4068</link>
    <description>&lt;DIV class="uconBody"&gt;&lt;DIV&gt; &lt;P&gt;&lt;SPAN style="color:windowtext"&gt;Hi Susamay&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&lt;SPAN style="color:windowtext"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&lt;SPAN style="color:windowtext"&gt;Thanks for the feedback much appreciated. I hope the Object helps.&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&lt;SPAN style="color:windowtext"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&lt;SPAN style="color:windowtext"&gt;Kind regards&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&lt;SPAN style="color:windowtext"&gt;Gavin&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&lt;SPAN style="color:windowtext"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 21 Feb 2024 06:15:00 GMT</pubDate>
    <dc:creator>GAVIN.RUDLING</dc:creator>
    <dc:date>2024-02-21T06:15:00Z</dc:date>
    <item>
      <title>C# or .NET code to print .msg files to PDF  with images</title>
      <link>https://community.blueprism.com/t5/Product-Forum/C-or-NET-code-to-print-msg-files-to-PDF-with-images/m-p/48547#M4060</link>
      <description>&lt;P&gt;Hello Team,&amp;nbsp;&lt;BR /&gt;I have a requirement to convert .msg files in specific folders to pdf. I have a C# code which uses the HTML from the email and converts to pdf. The drawback is that the&amp;nbsp; images are not printed in pdf.&amp;nbsp; So I am wondering is there any code and dll packages that could replicate the operation of printing the email like the way one normally prints email(File-&amp;gt;Print-&amp;gt;PrintToPDF).&lt;/P&gt;
&lt;P&gt;I have tried using the below links but couldn't implement it in BP&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/answers/questions/1280426/how-to-convert-outlook-email-(-msg)-to-pdf-c" target="_blank" rel="noopener"&gt;How to convert outlook email (.msg) to pdf c# ? - Microsoft Q&amp;amp;A&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.codeproject.com/Questions/5360739/How-do-I-convert-a-msg-file-to-a-pdf-file-using-Cs" target="_blank" rel="noopener"&gt;How do I convert a .msg file to a .pdf file using C#? - CodeProject&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Please let me know&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Susamay Halder Consultant&lt;BR /&gt;Consultant&lt;BR /&gt;Bruce Power&lt;BR /&gt;+1(437)217-1086&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Thu, 15 Feb 2024 14:21:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/C-or-NET-code-to-print-msg-files-to-PDF-with-images/m-p/48547#M4060</guid>
      <dc:creator>sonuiiml</dc:creator>
      <dc:date>2024-02-15T14:21:00Z</dc:date>
    </item>
    <item>
      <title>RE: C# or .NET code to print .msg files to PDF  with images</title>
      <link>https://community.blueprism.com/t5/Product-Forum/C-or-NET-code-to-print-msg-files-to-PDF-with-images/m-p/48548#M4061</link>
      <description>&lt;P&gt;Hi Susamay&lt;/P&gt;
&lt;P&gt;Recently I have been working on something very similar.&lt;/P&gt;
&lt;P&gt;I have uploaded a file, that I am still testing. I will tell you what it is supposed to do.&lt;/P&gt;
&lt;P&gt;Converts an Outlook msg file to pdf format.&lt;BR /&gt;If no output path is provided the code will create a .pdf file in the same directory as your .msg file. The path to the .pdf file will be returned as an output of the action.&lt;/P&gt;
&lt;P&gt;Please note that this code requires the Microsoft Outlook and Word applications to be installed on your machine.&lt;/P&gt;
&lt;P&gt;The .html file created during the process will be deleted at the end.&lt;/P&gt;
&lt;P&gt;Feel free to modify is as needed.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Gavin Rudling&lt;BR /&gt;Digital Consultant &amp;amp; Developer&lt;BR /&gt;Cog3nt&lt;BR /&gt;Africa/Johannesburg&lt;BR /&gt;0813906789&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Sat, 17 Feb 2024 10:09:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/C-or-NET-code-to-print-msg-files-to-PDF-with-images/m-p/48548#M4061</guid>
      <dc:creator>GAVIN.RUDLING</dc:creator>
      <dc:date>2024-02-17T10:09:00Z</dc:date>
    </item>
    <item>
      <title>RE: C# or .NET code to print .msg files to PDF  with images</title>
      <link>https://community.blueprism.com/t5/Product-Forum/C-or-NET-code-to-print-msg-files-to-PDF-with-images/m-p/48549#M4062</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi Susamay&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You can please ignore the 1st attachment, it does not work, some of the libraries were missing.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You can try this second attempt.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Kind regards&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Gavin&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Gavin Rudling&lt;BR /&gt;Digital Consultant &amp;amp; Developer&lt;BR /&gt;Cog3nt&lt;BR /&gt;Africa/Johannesburg&lt;BR /&gt;0813906789&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Mon, 19 Feb 2024 13:57:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/C-or-NET-code-to-print-msg-files-to-PDF-with-images/m-p/48549#M4062</guid>
      <dc:creator>GAVIN.RUDLING</dc:creator>
      <dc:date>2024-02-19T13:57:00Z</dc:date>
    </item>
    <item>
      <title>RE: C# or .NET code to print .msg files to PDF  with images</title>
      <link>https://community.blueprism.com/t5/Product-Forum/C-or-NET-code-to-print-msg-files-to-PDF-with-images/m-p/48550#M4063</link>
      <description>&lt;P&gt;Thank you so much Galvin. I am trying to run the code but it gives the below error&amp;nbsp;&lt;BR /&gt;Operation aborted (Exception from HRESULT: 0x80004004 (E_ABORT))&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Susamay Halder Consultant&lt;BR /&gt;Consultant&lt;BR /&gt;Bruce Power&lt;BR /&gt;+1(437)217-1086&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Mon, 19 Feb 2024 15:43:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/C-or-NET-code-to-print-msg-files-to-PDF-with-images/m-p/48550#M4063</guid>
      <dc:creator>sonuiiml</dc:creator>
      <dc:date>2024-02-19T15:43:00Z</dc:date>
    </item>
    <item>
      <title>RE: C# or .NET code to print .msg files to PDF  with images</title>
      <link>https://community.blueprism.com/t5/Product-Forum/C-or-NET-code-to-print-msg-files-to-PDF-with-images/m-p/48551#M4064</link>
      <description>&lt;P&gt;I tried running the code in a virtual machine and it gives the the below error&lt;BR /&gt;"Cannot create ActiveX component."&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Susamay Halder Consultant&lt;BR /&gt;Consultant&lt;BR /&gt;Bruce Power&lt;BR /&gt;+1(437)217-1086&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Mon, 19 Feb 2024 15:58:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/C-or-NET-code-to-print-msg-files-to-PDF-with-images/m-p/48551#M4064</guid>
      <dc:creator>sonuiiml</dc:creator>
      <dc:date>2024-02-19T15:58:00Z</dc:date>
    </item>
    <item>
      <title>RE: C# or .NET code to print .msg files to PDF  with images</title>
      <link>https://community.blueprism.com/t5/Product-Forum/C-or-NET-code-to-print-msg-files-to-PDF-with-images/m-p/48552#M4065</link>
      <description>&lt;P&gt;Hi Susamay&lt;/P&gt;
&lt;P&gt;One of my colleagues said he experienced the same thing.&lt;/P&gt;
&lt;P&gt;As I said, this is something new I am trying. I have it working on a BPC platform. My colleague says it works on one of our clients' environments as well, but not on his local machine.&lt;/P&gt;
&lt;P&gt;However he says if Outlook is open, it does work. I am trying to find out what the differences are in the environments.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Kind regards&lt;/P&gt;
&lt;P&gt;Gavin&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Gavin Rudling&lt;BR /&gt;Digital Consultant &amp;amp; Developer&lt;BR /&gt;Cog3nt&lt;BR /&gt;Africa/Johannesburg&lt;BR /&gt;0813906789&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Mon, 19 Feb 2024 18:02:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/C-or-NET-code-to-print-msg-files-to-PDF-with-images/m-p/48552#M4065</guid>
      <dc:creator>GAVIN.RUDLING</dc:creator>
      <dc:date>2024-02-19T18:02:00Z</dc:date>
    </item>
    <item>
      <title>RE: C# or .NET code to print .msg files to PDF  with images</title>
      <link>https://community.blueprism.com/t5/Product-Forum/C-or-NET-code-to-print-msg-files-to-PDF-with-images/m-p/48553#M4066</link>
      <description>&lt;P&gt;Hi Susamay&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Can you try the following:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;A href="https://community.blueprism.com/communities/community-home/digestviewer/viewthread?MessageKey=86bc24b0-515a-4e82-ad10-d0958b519606&amp;amp;CommunityKey=3b501789-976c-4cfa-b9db-88307c6a0a86&amp;amp;tab=digestviewer" class="tooltip-target" data-citationid="b7d7b72a-54d4-02ea-3cf3-4a928d4ed3a4-14-group" h="ID=SERP,5026.1" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;DLL files&lt;/STRONG&gt;: It might be that you need to add DLL:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;Microsoft.Office.Interop.Outlook.dll&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;into the Blue Prism folder&lt;/A&gt;&lt;A href="https://community.blueprism.com/communities/community-home/digestviewer/viewthread?MessageKey=86bc24b0-515a-4e82-ad10-d0958b519606&amp;amp;CommunityKey=3b501789-976c-4cfa-b9db-88307c6a0a86&amp;amp;tab=digestviewer" class="ac-anchor sup-target" target="_blank" data-citationid="b7d7b72a-54d4-02ea-3cf3-4a928d4ed3a4-14" aria-label="1: Microsoft.Office.Interop.Outlook.dll" h="ID=SERP,5026.1" rel="noopener"&gt;&lt;SUP class="citation-sup"&gt;1&lt;/SUP&gt;&lt;/A&gt;.&lt;/LI&gt;
&lt;/OL&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Gavin Rudling&lt;BR /&gt;Digital Consultant &amp;amp; Developer&lt;BR /&gt;Cog3nt&lt;BR /&gt;Africa/Johannesburg&lt;BR /&gt;0813906789&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Mon, 19 Feb 2024 18:26:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/C-or-NET-code-to-print-msg-files-to-PDF-with-images/m-p/48553#M4066</guid>
      <dc:creator>GAVIN.RUDLING</dc:creator>
      <dc:date>2024-02-19T18:26:00Z</dc:date>
    </item>
    <item>
      <title>RE: C# or .NET code to print .msg files to PDF  with images</title>
      <link>https://community.blueprism.com/t5/Product-Forum/C-or-NET-code-to-print-msg-files-to-PDF-with-images/m-p/48554#M4067</link>
      <description>&lt;P&gt;Hi Gavin,&amp;nbsp;&lt;BR /&gt;Thank you so much for your support. I found the reason why the error was thrown. Its because of security policies. Its working fine in my personal machine since I am the administrator. However, for my office laptop the security policies are restricting it from happening at first place.&lt;BR /&gt;Below is the article for reference&amp;nbsp;&lt;BR /&gt;&lt;A href="https://learn.microsoft.com/en-AU/outlook/troubleshoot/security/a-program-is-trying-to-send-an-email-message-on-your-behalf" target="_blank" rel="noopener"&gt;Program is trying to send an e-mail message on your behalf - Outlook | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;After referring to the article I believe the below change needs to be implemented as an administrator&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Found out that it was blocked by the following policy: HKEY_CURRENT_USER\Software\Policies\Microsoft\office\16.0\outlook\security\promptoomsaveas&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;The key was set to 0 = Automatically Deny. Changing the key to 2 = Automatically Approve solved the problem&lt;BR /&gt;&lt;BR /&gt;Could you try in that machine where it is not working? I hope it will work&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Susamay Halder Consultant&lt;BR /&gt;Consultant&lt;BR /&gt;Bruce Power&lt;BR /&gt;+1(437)217-1086&lt;BR /&gt;------------------------------&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2024 16:32:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/C-or-NET-code-to-print-msg-files-to-PDF-with-images/m-p/48554#M4067</guid>
      <dc:creator>sonuiiml</dc:creator>
      <dc:date>2024-02-20T16:32:00Z</dc:date>
    </item>
    <item>
      <title>RE: C# or .NET code to print .msg files to PDF  with images</title>
      <link>https://community.blueprism.com/t5/Product-Forum/C-or-NET-code-to-print-msg-files-to-PDF-with-images/m-p/48555#M4068</link>
      <description>&lt;DIV class="uconBody"&gt;&lt;DIV&gt; &lt;P&gt;&lt;SPAN style="color:windowtext"&gt;Hi Susamay&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&lt;SPAN style="color:windowtext"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&lt;SPAN style="color:windowtext"&gt;Thanks for the feedback much appreciated. I hope the Object helps.&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&lt;SPAN style="color:windowtext"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&lt;SPAN style="color:windowtext"&gt;Kind regards&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&lt;SPAN style="color:windowtext"&gt;Gavin&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&lt;SPAN style="color:windowtext"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Feb 2024 06:15:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/C-or-NET-code-to-print-msg-files-to-PDF-with-images/m-p/48555#M4068</guid>
      <dc:creator>GAVIN.RUDLING</dc:creator>
      <dc:date>2024-02-21T06:15:00Z</dc:date>
    </item>
  </channel>
</rss>

