<?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 Macro in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Macro/m-p/998990#M339682</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone explain me what this below macro does?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub SendMail&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set myApp = CreateObject ("Outlook.Application")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set myMessage = myApp.CreateItem(olMailItem)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;myMessage.BodyFormat = 3 'Outlook.OlBodyFormat.olFormatRichText&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'Agency = ActiveDocument.Variables("v").GetContent.String&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;myMessage.Subject = "Request to change agency segment"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'call GetPossibleValues ("E-mail 1","strTo",",")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;strTo = ActiveDocument.Variables("vEmailID").GetContent.String&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;myMessage.To = strTo&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set myInspector = myMessage.GetInspector 'this inserts signature to e-mail&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set myDoc = myInspector.WordEditor&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ActiveDocument.GetSheetObject("TX149").CopyTextToClipboard&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;myText = ActiveDocument.GetSheetObject("TX149").GetText 'this is needed to calculate the lenght of the iserted text to put the next object after it&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'myText = myText &amp;amp; ActiveDocument.GetSheetObject("TX146").GetText&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;myDoc.Range(0,0).Paste 'This pastes at the begining of the message body&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'ActiveDocument.GetSheetObject("TX146").CopyTextToClipboard&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'myText = myText &amp;amp; ActiveDocument.GetSheetObject("TX146").GetText 'this is needed to calculate the lenght of the iserted text to put the next object after it&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ActiveDocument.GetSheetObject("LA36").CopyTableToClipboard true&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;myDoc.Range(len(myText),len(myText)).Paste 'Pastes after the previous text&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;' myDoc.Range(myDoc.Characters.Count-1, myDoc.Characters.Count).Paste 'Pastes at the end of the message body&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;' myMessage.GetInspector.WordEditor.Range.Paste 'Replaces the entire message body with clipboard content&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;' myInspector.WordEditor.Content.InsertAfter chr(13) 'inserts an empty string at the end of the message body content&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;myMessage.Display&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set myMessage = Nothing &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set myApp = Nothing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set myInspector = Nothing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set myDoc = Nothing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 16 Nov 2015 02:50:20 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-11-16T02:50:20Z</dc:date>
    <item>
      <title>Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Macro/m-p/998990#M339682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone explain me what this below macro does?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub SendMail&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set myApp = CreateObject ("Outlook.Application")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set myMessage = myApp.CreateItem(olMailItem)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;myMessage.BodyFormat = 3 'Outlook.OlBodyFormat.olFormatRichText&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'Agency = ActiveDocument.Variables("v").GetContent.String&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;myMessage.Subject = "Request to change agency segment"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'call GetPossibleValues ("E-mail 1","strTo",",")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;strTo = ActiveDocument.Variables("vEmailID").GetContent.String&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;myMessage.To = strTo&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set myInspector = myMessage.GetInspector 'this inserts signature to e-mail&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set myDoc = myInspector.WordEditor&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ActiveDocument.GetSheetObject("TX149").CopyTextToClipboard&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;myText = ActiveDocument.GetSheetObject("TX149").GetText 'this is needed to calculate the lenght of the iserted text to put the next object after it&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'myText = myText &amp;amp; ActiveDocument.GetSheetObject("TX146").GetText&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;myDoc.Range(0,0).Paste 'This pastes at the begining of the message body&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'ActiveDocument.GetSheetObject("TX146").CopyTextToClipboard&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'myText = myText &amp;amp; ActiveDocument.GetSheetObject("TX146").GetText 'this is needed to calculate the lenght of the iserted text to put the next object after it&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ActiveDocument.GetSheetObject("LA36").CopyTableToClipboard true&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;myDoc.Range(len(myText),len(myText)).Paste 'Pastes after the previous text&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;' myDoc.Range(myDoc.Characters.Count-1, myDoc.Characters.Count).Paste 'Pastes at the end of the message body&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;' myMessage.GetInspector.WordEditor.Range.Paste 'Replaces the entire message body with clipboard content&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;' myInspector.WordEditor.Content.InsertAfter chr(13) 'inserts an empty string at the end of the message body content&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;myMessage.Display&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set myMessage = Nothing &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set myApp = Nothing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set myInspector = Nothing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set myDoc = Nothing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Nov 2015 02:50:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro/m-p/998990#M339682</guid>
      <dc:creator />
      <dc:date>2015-11-16T02:50:20Z</dc:date>
    </item>
  </channel>
</rss>

