<?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 Code snippet to paste a chart image into outlook email in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Code-snippet-to-paste-a-chart-image-into-outlook-email/m-p/141994#M21568</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use the code below to copy the sheet and attach it in the Mail client&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For a button i assign three actions&lt;/P&gt;&lt;P&gt;1) Run Macro - CaptureScreen - to save the screenshot of the sheet and save it in C drive.&lt;/P&gt;&lt;P&gt;2) Launch - select you mail client application&lt;/P&gt;&lt;P&gt;3) Run Macro - Insert image in mail&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub CaptureScreen&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActiveDocument.ActiveSheet.ExportBitmapToFile "C:\Snapshot.PNG"&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'msgbox "Screen capture is stored in C:\Snapshot.JPG."&lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub InsertImageInMail&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActiveDocument.GetApplication.Sleep 2000&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set objShell = CreateObject("WScript.Shell")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; objShell.SendKeys "%FNM" - short cut keys for attachment&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; objShell.SendKeys "%IA" --short cut keys for attachment&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; objShell.SendKeys "C:\Snapshot.PNG"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; objShell.SendKeys "{ENTER}"&lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 03 Feb 2012 10:55:25 GMT</pubDate>
    <dc:creator>jagan</dc:creator>
    <dc:date>2012-02-03T10:55:25Z</dc:date>
    <item>
      <title>Code snippet to paste a chart image into outlook email</title>
      <link>https://community.qlik.com/t5/QlikView/Code-snippet-to-paste-a-chart-image-into-outlook-email/m-p/141988#M21562</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have been banging my head against a brick wall for hours now. I can paste a table into a new email message but I now need to paste an image of a chart and I just can't see what syntax to use.&lt;/P&gt;&lt;P&gt;This is my current code...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;Dim objOutlk 'Outlook&lt;BR /&gt;Dim objMail 'Email item&lt;BR /&gt;Dim strMsg&lt;BR /&gt;'Create a new message&lt;BR /&gt;Set objOutlk = createobject("Outlook.Application")&lt;BR /&gt;Set objMail = objOutlk.createitem(olMailItem)&lt;BR /&gt;with objMail&lt;BR /&gt; .To = MailTo&lt;BR /&gt; .subject = ExtraText &amp;amp; MailReport &amp;amp; " at " &amp;amp; YesterdayD &amp;amp; " for " &amp;amp; vstart &amp;amp; " to " &amp;amp; vend&lt;BR /&gt; strMsg = vbcrlf &amp;amp; objeMail.gettext &amp;amp; vbcrlf&lt;BR /&gt;&lt;BR /&gt; rem ** copy full table to clipboard **&lt;BR /&gt; objReport.CopyTableToClipboard true&lt;BR /&gt; .GetInspector.WordEditor.Range.Paste&lt;BR /&gt; .GetInspector.WordEditor.Content.InsertAfter strMsg&lt;BR /&gt; .Send&lt;BR /&gt;end with&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;I would appreciate some help please.&lt;/P&gt;&lt;P&gt;TIA, Jane&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2009 20:31:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Code-snippet-to-paste-a-chart-image-into-outlook-email/m-p/141988#M21562</guid>
      <dc:creator />
      <dc:date>2009-04-21T20:31:49Z</dc:date>
    </item>
    <item>
      <title>Code snippet to paste a chart image into outlook email</title>
      <link>https://community.qlik.com/t5/QlikView/Code-snippet-to-paste-a-chart-image-into-outlook-email/m-p/141989#M21563</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jane,&lt;/P&gt;&lt;P&gt;I believe you want to use an API called "CopyBitmapToClipboard":&lt;/P&gt;&lt;P&gt;Hee is an example:&lt;/P&gt;&lt;P&gt;ActiveDocument.GetSheetObject("CH01").CopyBitmapToClipboard&lt;/P&gt;&lt;P&gt;good luck!&lt;/P&gt;&lt;P&gt;Oleg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2009 20:47:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Code-snippet-to-paste-a-chart-image-into-outlook-email/m-p/141989#M21563</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2009-04-21T20:47:30Z</dc:date>
    </item>
    <item>
      <title>Code snippet to paste a chart image into outlook email</title>
      <link>https://community.qlik.com/t5/QlikView/Code-snippet-to-paste-a-chart-image-into-outlook-email/m-p/141990#M21564</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Oleg,&lt;/P&gt;&lt;P&gt;I am OK with the QlikView bit, its the code to pop it into an email thats doing me in. I know its not strictly QlikView but I thought I would ask &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Jane&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2009 22:09:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Code-snippet-to-paste-a-chart-image-into-outlook-email/m-p/141990#M21564</guid>
      <dc:creator />
      <dc:date>2009-04-21T22:09:17Z</dc:date>
    </item>
    <item>
      <title>Code snippet to paste a chart image into outlook email</title>
      <link>https://community.qlik.com/t5/QlikView/Code-snippet-to-paste-a-chart-image-into-outlook-email/m-p/141991#M21565</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The only email image syntax I could get to work was "AddRelatedBodyPart" function. It can paste in an image into the body of the email, I could only get it to work with a single image. Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function sendMail&lt;BR /&gt; Dim objEmail&lt;BR /&gt; Dim strMailTo&lt;BR /&gt;&lt;BR /&gt; Const CdoReferenceTypeName = 1&lt;BR /&gt; Const cdoSendUsingPort = 2 ' Send the message using SMTP&lt;BR /&gt; 'Const cdoBasicAuth = 1 ' Clear-text authentication&lt;BR /&gt; Const cdoTimeout = 60 ' Timeout for SMTP in seconds&lt;BR /&gt; 'Const cdoPort = 25 ' Port number for SMTP&lt;BR /&gt;&lt;BR /&gt; Const cdoNTLM = 2&lt;BR /&gt;&lt;BR /&gt; 'Const cdoDSNSuccessFailOrDelay = 14 'Success, failure or delay&lt;BR /&gt;&lt;BR /&gt; ' Create bitmap of sheet&lt;BR /&gt; ActiveDocument.ActivateSheetByID "SH01"&lt;BR /&gt; ActiveDocument.Sheets("SH01").ExportBitmapToFile "C:\temp\SH01.png"&lt;BR /&gt;&lt;BR /&gt; 'Get Selected values from field "mailto"&lt;BR /&gt; Set objSelected = ActiveDocument.Fields("mailto").GetSelectedValues&lt;BR /&gt;&lt;BR /&gt; if objSelected.Count = 0 then ' Nothing Selected&lt;BR /&gt; msgbox ("No e-mail reciepient selected")&lt;BR /&gt; exit function&lt;BR /&gt; else&lt;BR /&gt; 'Sending mail&lt;BR /&gt; Set objEmail = CreateObject("CDO.Message")&lt;BR /&gt; Set objConf = objEmail.Configuration&lt;BR /&gt; Set objFlds = objConf.Fields&lt;BR /&gt;&lt;BR /&gt; With objFlds&lt;BR /&gt; '---------------------------------------------------------------------&lt;BR /&gt; ' SMTP server details&lt;BR /&gt; .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort&lt;BR /&gt; .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = getVariable("mailServer")&lt;BR /&gt; .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoNTLM&lt;BR /&gt; .Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = getVariable("mailServerUsername")&lt;BR /&gt; .Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = getVariable("mailServerPassword")&lt;BR /&gt; .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = getVariable("SMTPport")&lt;BR /&gt; .Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False&lt;BR /&gt; .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = cdoTimeout&lt;BR /&gt; .Update&lt;BR /&gt; '---------------------------------------------------------------------&lt;BR /&gt; End With&lt;BR /&gt;&lt;BR /&gt; For i = 0 to objSelected.Count-1 ' create mailTo list&lt;BR /&gt; strMailTo = strMailTo &amp;amp; objSelected.item(i).Text &amp;amp; ";"&lt;BR /&gt; next&lt;BR /&gt;&lt;BR /&gt; objEmail.MimeFormatted = True&lt;BR /&gt; strMailTo = left(strMailTo,len(strMailTo)-1) ' remove the last ; in list&lt;BR /&gt; objEmail.To = strMailTo&lt;BR /&gt; objEmail.From = "qvadmin@company.com"&lt;BR /&gt; objEmail.Subject = getVariable("mailSubject")&lt;BR /&gt;&lt;BR /&gt; 'objEmail.HTMLBody = "&amp;lt;html&amp;gt;Check this out: &amp;lt;img src=""cid:report.bmp""&amp;gt;&amp;lt;/html&amp;gt;"&lt;BR /&gt;&lt;BR /&gt; objEmail.HTMLBody = "&amp;lt;html&amp;gt;Check this out: &amp;lt;/html&amp;gt;"&lt;BR /&gt; objEmail.AddRelatedBodyPart "C:\TEMP\SH01.png", "SH01.png", CdoReferenceTypeName&lt;BR /&gt;&lt;BR /&gt; objEmail.Send&lt;BR /&gt;&lt;BR /&gt; Set objFlds = Nothing&lt;BR /&gt; Set objConf = Nothing&lt;BR /&gt; Set objEmail = Nothing&lt;BR /&gt; end if&lt;BR /&gt; 'msgbox ("Mail Sent")&lt;BR /&gt;end function&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2009 03:24:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Code-snippet-to-paste-a-chart-image-into-outlook-email/m-p/141991#M21565</guid>
      <dc:creator />
      <dc:date>2009-04-22T03:24:57Z</dc:date>
    </item>
    <item>
      <title>Code snippet to paste a chart image into outlook email</title>
      <link>https://community.qlik.com/t5/QlikView/Code-snippet-to-paste-a-chart-image-into-outlook-email/m-p/141992#M21566</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tom, Thanks so much I will defo give this a try. It's not very easy is it?&lt;/P&gt;&lt;P&gt;All the best,&lt;/P&gt;&lt;P&gt;Jane&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2009 22:37:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Code-snippet-to-paste-a-chart-image-into-outlook-email/m-p/141992#M21566</guid>
      <dc:creator />
      <dc:date>2009-04-22T22:37:40Z</dc:date>
    </item>
    <item>
      <title>Code snippet to paste a chart image into outlook email</title>
      <link>https://community.qlik.com/t5/QlikView/Code-snippet-to-paste-a-chart-image-into-outlook-email/m-p/141993#M21567</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried this. Doesnt work....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Feb 2012 10:11:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Code-snippet-to-paste-a-chart-image-into-outlook-email/m-p/141993#M21567</guid>
      <dc:creator />
      <dc:date>2012-02-03T10:11:49Z</dc:date>
    </item>
    <item>
      <title>Code snippet to paste a chart image into outlook email</title>
      <link>https://community.qlik.com/t5/QlikView/Code-snippet-to-paste-a-chart-image-into-outlook-email/m-p/141994#M21568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use the code below to copy the sheet and attach it in the Mail client&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For a button i assign three actions&lt;/P&gt;&lt;P&gt;1) Run Macro - CaptureScreen - to save the screenshot of the sheet and save it in C drive.&lt;/P&gt;&lt;P&gt;2) Launch - select you mail client application&lt;/P&gt;&lt;P&gt;3) Run Macro - Insert image in mail&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub CaptureScreen&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActiveDocument.ActiveSheet.ExportBitmapToFile "C:\Snapshot.PNG"&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'msgbox "Screen capture is stored in C:\Snapshot.JPG."&lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub InsertImageInMail&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActiveDocument.GetApplication.Sleep 2000&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set objShell = CreateObject("WScript.Shell")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; objShell.SendKeys "%FNM" - short cut keys for attachment&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; objShell.SendKeys "%IA" --short cut keys for attachment&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; objShell.SendKeys "C:\Snapshot.PNG"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; objShell.SendKeys "{ENTER}"&lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Feb 2012 10:55:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Code-snippet-to-paste-a-chart-image-into-outlook-email/m-p/141994#M21568</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2012-02-03T10:55:25Z</dc:date>
    </item>
    <item>
      <title>Code snippet to paste a chart image into outlook email</title>
      <link>https://community.qlik.com/t5/QlikView/Code-snippet-to-paste-a-chart-image-into-outlook-email/m-p/141995#M21569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi jagan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tyvm, i&amp;nbsp; learn a new function "CaptureScreen"&amp;nbsp;&amp;nbsp; ha&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but not clear your second function “select you mail client application”&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how to do that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lee&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Mar 2012 02:37:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Code-snippet-to-paste-a-chart-image-into-outlook-email/m-p/141995#M21569</guid>
      <dc:creator />
      <dc:date>2012-03-05T02:37:09Z</dc:date>
    </item>
    <item>
      <title>Re: Code snippet to paste a chart image into outlook email</title>
      <link>https://community.qlik.com/t5/QlikView/Code-snippet-to-paste-a-chart-image-into-outlook-email/m-p/141996#M21570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assign an Action to Button, as shown in the screen shot, now select you mail client like Outlook, Lotus Notes etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Mar 2012 06:27:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Code-snippet-to-paste-a-chart-image-into-outlook-email/m-p/141996#M21570</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2012-03-05T06:27:25Z</dc:date>
    </item>
    <item>
      <title>Re: Code snippet to paste a chart image into outlook email</title>
      <link>https://community.qlik.com/t5/QlikView/Code-snippet-to-paste-a-chart-image-into-outlook-email/m-p/141997#M21571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi Jane ,&lt;/P&gt;&lt;P&gt;can you please share the code to send a table as an object in a mail body through Qlikview Macro .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Need it urgently ,&lt;/P&gt;&lt;P&gt;Help Appreciated&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Feb 2015 10:02:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Code-snippet-to-paste-a-chart-image-into-outlook-email/m-p/141997#M21571</guid>
      <dc:creator />
      <dc:date>2015-02-26T10:02:18Z</dc:date>
    </item>
  </channel>
</rss>

