<?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 Could be the CreateObject… in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/Outlook-2016-Object-Send-Mail-Code-Stage/m-p/53320#M8037</link>
    <description>Could be the CreateObject line is failing. Try referencing C:\Program Files (x86)\Microsoft Office\root\Microsoft.Office.Interop.Outlook.dll</description>
    <pubDate>Thu, 01 Mar 2018 17:08:00 GMT</pubDate>
    <dc:creator>John__Carter</dc:creator>
    <dc:date>2018-03-01T17:08:00Z</dc:date>
    <item>
      <title>Outlook 2016 Object - Send Mail Code Stage</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Outlook-2016-Object-Send-Mail-Code-Stage/m-p/53319#M8036</link>
      <description>Hi everyone,

I have the following code that works perfectly as an excel macro:

Dim objOutlook As Object
Dim objMail As Object
Dim aPath As String
Dim CRLFLF As String
Dim CRLF As String

CRLFLF = Chr(10) &amp;amp; Chr(13) &amp;amp; Chr(10) &amp;amp; Chr(13)
CRLF = Chr(10) &amp;amp; Chr(13)

Set objOutlook = CreateObject("Outlook.Application")
Set objMail = objOutlook.CreateItem(0)

aPath = "Bla Bla Path"


With objMail
&amp;nbsp;&amp;nbsp; .BodyFormat = 1
&amp;nbsp;&amp;nbsp; .To = "mail1"
&amp;nbsp;&amp;nbsp; .CC = "mail2"
&amp;nbsp;&amp;nbsp; .Subject = "Hobby Request"
&amp;nbsp;&amp;nbsp; .Body = "Dear all " &amp;amp; CRLF &amp;amp; "Please list 5 Hobbys " &amp;amp; CRLF &amp;amp; "Best Regards" &amp;amp; Chr(10) &amp;amp; Environ("USERNAME")
&amp;nbsp;&amp;nbsp; .Attachments.Add aPath
&amp;nbsp;&amp;nbsp; .Display

End With

&amp;nbsp;

When I transfer it to BluePrism it doesn't work anymore throwing the following error:&amp;nbsp;"Internal : Exception: Object reference not set to an instance of an object."

I've set the global variables in the initialise page, I know that "Set and Let are not supported" but still doesn't work. The Language is set to Visual Basic, the internal references are : "System.dll, System.Data.dll, System.Xml.dll, System.Drawing.dll" and Namespace Imports are: "System, System.Drawing,System.Data"

Can someone please help me with this issue.

Thank you in advance!

&amp;nbsp;</description>
      <pubDate>Thu, 01 Mar 2018 15:38:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Outlook-2016-Object-Send-Mail-Code-Stage/m-p/53319#M8036</guid>
      <dc:creator>CalinSandulescu</dc:creator>
      <dc:date>2018-03-01T15:38:00Z</dc:date>
    </item>
    <item>
      <title>Could be the CreateObject…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Outlook-2016-Object-Send-Mail-Code-Stage/m-p/53320#M8037</link>
      <description>Could be the CreateObject line is failing. Try referencing C:\Program Files (x86)\Microsoft Office\root\Microsoft.Office.Interop.Outlook.dll</description>
      <pubDate>Thu, 01 Mar 2018 17:08:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Outlook-2016-Object-Send-Mail-Code-Stage/m-p/53320#M8037</guid>
      <dc:creator>John__Carter</dc:creator>
      <dc:date>2018-03-01T17:08:00Z</dc:date>
    </item>
  </channel>
</rss>

