<?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 Pass field value to Module/Macro in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Pass-field-value-to-Module-Macro/m-p/87896#M603629</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: #000000; font-family: 'Courier New';"&gt;&lt;SPAN style="font-size: 9pt; font-family: arial, helvetica, sans-serif;"&gt;Need to send the value of the field [Contract] to a &lt;/SPAN&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;&lt;SPAN style="font-size: 12px;"&gt;function&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt;"&gt; in the Module editor where VBScript will send an email. I have tried to get it to work in many ways and the example below is but one. The email part works but the Subject shows blank when the email is delivered. I need to fill in 'Subject' with the value &lt;SPAN style="font-size: 10pt;"&gt;of [Contract]. Once I get this to work&lt;/SPAN&gt; I will need to do the same for text body. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: #000000; font-size: 9pt; font-family: arial, helvetica, sans-serif;"&gt;Should I be using Sub instead of Function? I tried but could not get the email to send with SUB.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;STRONG style=": ; font-size: 14pt; text-decoration: underline;"&gt;Load Script&lt;/STRONG&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;ContractAlert:&lt;BR /&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 9.0pt; font-family: 'Courier New';"&gt;Load&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; * &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;Inline&lt;/SPAN&gt; &lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;[ &lt;BR /&gt; Name, UserId, &lt;SPAN style="color: #ff00ff;"&gt;Contract,&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RenewContractDate,&amp;nbsp; Email&lt;BR /&gt; Bob, BOBM12,&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #ff00ff;"&gt;56940,&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6/20/2018, &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:Bobm@CFG123.com"&gt;Bobm@CFG123.com&lt;/A&gt;&lt;BR /&gt; ]&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 9.0pt; font-family: 'Courier New';"&gt;LET&lt;/STRONG&gt; &lt;STRONG&gt;&lt;EM style=": ; color: #ff00ff; font-size: 9.0pt; font-family: 'Courier New';"&gt;xCon&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New'; color: #ff00ff;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #ff00ff; font-size: 9.0pt; font-family: 'Courier New';"&gt;Contract&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 9.0pt; font-family: 'Courier New';"&gt;LET&lt;/STRONG&gt; &lt;STRONG&gt;&lt;EM style="color: gray; font-size: 9.0pt; font-family: 'Courier New';"&gt;vSendEmail&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;SendEmail&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;SPAN style="color: #ff00ff;"&gt;xCon&lt;/SPAN&gt;);&lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; font-size: 14pt; text-decoration: underline;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Module VBScript&lt;/SPAN&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;Function SendEmail(xCon)&lt;BR /&gt;&amp;nbsp; Set emailObj&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = CreateObject("CDO.Message")&lt;BR /&gt; emailObj.From&amp;nbsp;&amp;nbsp;&amp;nbsp; = "&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:Bobm@CFG123.com"&gt;Bobm@CFG123.com&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; "&lt;BR /&gt; emailObj.To&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = "&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:Bobm@CFG123.com"&gt;Bobm@CFG123.com&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; "&lt;BR /&gt; emailObj.Subject&amp;nbsp; = &lt;SPAN style="color: #ff00ff;"&gt;xCon&lt;/SPAN&gt;&lt;BR /&gt; emailObj.TextBody = "Test Send Email"&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt; Set emailConfig = emailObj.Configuration&lt;BR /&gt; &lt;BR /&gt;&lt;SPAN&gt; emailConfig.Fields("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://schemas.microsoft.com/cdo/configuration/smtpserver" rel="nofollow" target="_blank"&gt;http://schemas.microsoft.com/cdo/configuration/smtpserver&lt;/A&gt;&lt;SPAN&gt;") = "10.52.43.34"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; emailConfig.Fields("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://schemas.microsoft.com/cdo/configuration/smtpserverport" rel="nofollow" target="_blank"&gt;http://schemas.microsoft.com/cdo/configuration/smtpserverport&lt;/A&gt;&lt;SPAN&gt;" &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 27 Jun 2018 17:16:14 GMT</pubDate>
    <dc:creator>dhborchardt</dc:creator>
    <dc:date>2018-06-27T17:16:14Z</dc:date>
    <item>
      <title>Pass field value to Module/Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Pass-field-value-to-Module-Macro/m-p/87896#M603629</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: #000000; font-family: 'Courier New';"&gt;&lt;SPAN style="font-size: 9pt; font-family: arial, helvetica, sans-serif;"&gt;Need to send the value of the field [Contract] to a &lt;/SPAN&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;&lt;SPAN style="font-size: 12px;"&gt;function&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt;"&gt; in the Module editor where VBScript will send an email. I have tried to get it to work in many ways and the example below is but one. The email part works but the Subject shows blank when the email is delivered. I need to fill in 'Subject' with the value &lt;SPAN style="font-size: 10pt;"&gt;of [Contract]. Once I get this to work&lt;/SPAN&gt; I will need to do the same for text body. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: #000000; font-size: 9pt; font-family: arial, helvetica, sans-serif;"&gt;Should I be using Sub instead of Function? I tried but could not get the email to send with SUB.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;STRONG style=": ; font-size: 14pt; text-decoration: underline;"&gt;Load Script&lt;/STRONG&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;ContractAlert:&lt;BR /&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 9.0pt; font-family: 'Courier New';"&gt;Load&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; * &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;Inline&lt;/SPAN&gt; &lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;[ &lt;BR /&gt; Name, UserId, &lt;SPAN style="color: #ff00ff;"&gt;Contract,&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RenewContractDate,&amp;nbsp; Email&lt;BR /&gt; Bob, BOBM12,&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #ff00ff;"&gt;56940,&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6/20/2018, &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:Bobm@CFG123.com"&gt;Bobm@CFG123.com&lt;/A&gt;&lt;BR /&gt; ]&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 9.0pt; font-family: 'Courier New';"&gt;LET&lt;/STRONG&gt; &lt;STRONG&gt;&lt;EM style=": ; color: #ff00ff; font-size: 9.0pt; font-family: 'Courier New';"&gt;xCon&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New'; color: #ff00ff;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #ff00ff; font-size: 9.0pt; font-family: 'Courier New';"&gt;Contract&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 9.0pt; font-family: 'Courier New';"&gt;LET&lt;/STRONG&gt; &lt;STRONG&gt;&lt;EM style="color: gray; font-size: 9.0pt; font-family: 'Courier New';"&gt;vSendEmail&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;SendEmail&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;SPAN style="color: #ff00ff;"&gt;xCon&lt;/SPAN&gt;);&lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; font-size: 14pt; text-decoration: underline;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Module VBScript&lt;/SPAN&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;Function SendEmail(xCon)&lt;BR /&gt;&amp;nbsp; Set emailObj&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = CreateObject("CDO.Message")&lt;BR /&gt; emailObj.From&amp;nbsp;&amp;nbsp;&amp;nbsp; = "&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:Bobm@CFG123.com"&gt;Bobm@CFG123.com&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; "&lt;BR /&gt; emailObj.To&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = "&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:Bobm@CFG123.com"&gt;Bobm@CFG123.com&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; "&lt;BR /&gt; emailObj.Subject&amp;nbsp; = &lt;SPAN style="color: #ff00ff;"&gt;xCon&lt;/SPAN&gt;&lt;BR /&gt; emailObj.TextBody = "Test Send Email"&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt; Set emailConfig = emailObj.Configuration&lt;BR /&gt; &lt;BR /&gt;&lt;SPAN&gt; emailConfig.Fields("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://schemas.microsoft.com/cdo/configuration/smtpserver" rel="nofollow" target="_blank"&gt;http://schemas.microsoft.com/cdo/configuration/smtpserver&lt;/A&gt;&lt;SPAN&gt;") = "10.52.43.34"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; emailConfig.Fields("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://schemas.microsoft.com/cdo/configuration/smtpserverport" rel="nofollow" target="_blank"&gt;http://schemas.microsoft.com/cdo/configuration/smtpserverport&lt;/A&gt;&lt;SPAN&gt;" &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jun 2018 17:16:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pass-field-value-to-Module-Macro/m-p/87896#M603629</guid>
      <dc:creator>dhborchardt</dc:creator>
      <dc:date>2018-06-27T17:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: Pass field value to Module/Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Pass-field-value-to-Module-Macro/m-p/87897#M603630</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dale&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assuming you have trapped the value of the Email Subject in a variable named "vEmailSubject", you can read this variable in the Macro and use this value for the emailObj.Subject:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set v = ActiveDocument.Variables("vEmailSubject")&lt;/P&gt;&lt;P&gt;emailObj.Subject = v.GetContent.String&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To trap the Contract field value into the variable, you can use either Peek(If the table has only 1 row) or LookUp(table has multiple rows and you know the user ID/key field value whose row you want to read).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want a return value, a Function is used). For ex., you may want to notify if the email was successfully sent).&lt;/P&gt;&lt;P&gt;If you want to send an email and you do not care if the processing is successful or not, you may use a Sub.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2018 05:43:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pass-field-value-to-Module-Macro/m-p/87897#M603630</guid>
      <dc:creator>vupen</dc:creator>
      <dc:date>2018-06-28T05:43:29Z</dc:date>
    </item>
    <item>
      <title>Re: Pass field value to Module/Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Pass-field-value-to-Module-Macro/m-p/87898#M603631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: black; font-size: 9.0pt; font-family: arial, helvetica, sans-serif;"&gt;Thank you for the direction. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9pt; font-family: arial, helvetica, sans-serif; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-size: 9.0pt; font-family: arial, helvetica, sans-serif;"&gt;There might be none, one or more emails that will need to go out depending on due date. I am assuming I can use peek if I am handling only one row at a time with For/Next?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-size: 9.0pt; font-family: arial, helvetica, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-size: 9.0pt; font-family: arial, helvetica, sans-serif;"&gt;I attempted to trap the 'Contact' field', not sure if I did it correct. I added the two line you gave me to the module but if either of them are run the email will not send. Is my syntax correct? &lt;SPAN style="color: #ff00ff;"&gt;See below new lines are in this color&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;Is there a way to test to see if the variable made it to the module? I try to run msgbox but it does not seem to run from the module.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;STRONG style="font-size: 14pt; font-family: 'Courier New'; color: #000000;"&gt;Load Script&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;ContractAlert:&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 9.0pt; font-family: 'Courier New';"&gt;LOAD&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; * ,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;Today&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;()-&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;RenewContractDate&lt;/SPAN&gt; &lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;AS&lt;/SPAN&gt; &lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;Noofdays&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 9.0pt; font-family: 'Courier New';"&gt;Load&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; * &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;Inline&lt;/SPAN&gt; &lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;[ &lt;BR /&gt; Name, UserId, Contract,&amp;nbsp;&amp;nbsp;&amp;nbsp; RenewContractDate,&amp;nbsp; Email&lt;BR /&gt;&lt;SPAN&gt; Bob, bobH00,&amp;nbsp;&amp;nbsp;&amp;nbsp; 56940,&amp;nbsp;&amp;nbsp;&amp;nbsp; 6/20/2018, &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:bob@CFG123.org"&gt;bob@CFG123.org&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt; Joe, JoeH01,&amp;nbsp;&amp;nbsp;&amp;nbsp; 12342,&amp;nbsp;&amp;nbsp;&amp;nbsp; 6/14/2018, &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:joe@CFG123.org"&gt;joe@CFG123.org&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt; Sally,&amp;nbsp;&amp;nbsp;&amp;nbsp; SalH01,&amp;nbsp; 29846,&amp;nbsp;&amp;nbsp;&amp;nbsp; 6/12/2018, &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:sally@CFG123.org"&gt;sally@CFG123.org&lt;/A&gt;&lt;BR /&gt; ]&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;;&lt;BR /&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: green;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 9.0pt; font-family: 'Courier New';"&gt;LET&lt;/STRONG&gt; &lt;STRONG&gt;&lt;EM style="color: gray; font-size: 9.0pt; font-family: 'Courier New';"&gt;NumRows&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;NoOfRows&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;('ContractAlert') ;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 9.0pt; font-family: 'Courier New';"&gt;FOR&lt;/STRONG&gt; &lt;STRONG&gt;&lt;EM style="color: gray; font-size: 9.0pt; font-family: 'Courier New';"&gt;i&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;=1 &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;to&lt;/SPAN&gt; &lt;STRONG&gt;&lt;EM style="color: gray; font-size: 9.0pt; font-family: 'Courier New';"&gt;$(NumRows)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #ff00ff; font-size: 9.0pt; font-family: 'Courier New';"&gt;LET&lt;/STRONG&gt;&lt;SPAN style="color: #ff00ff;"&gt; &lt;STRONG&gt;&lt;EM style="font-size: 9pt; font-family: 'Courier New';"&gt;vEmailSubject&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New';"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New';"&gt;Peek&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New';"&gt;('Contract',&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="font-size: 9pt; font-family: 'Courier New';"&gt;$(i)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New';"&gt;);&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="font-size: 9pt; font-family: 'Courier New';"&gt;LET&lt;/STRONG&gt; &lt;STRONG&gt;&lt;EM style="font-size: 9pt; font-family: 'Courier New';"&gt;vSendEmail&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New';"&gt; = &lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New';"&gt;SendEmail&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;SPAN style="color: #ff00ff;"&gt; (vEmailSubject);&lt;/SPAN&gt;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 9.0pt; font-family: 'Courier New';"&gt;NEXT&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;STRONG style="color: #3d3d3d; font-size: 14pt; font-style: inherit; font-family: 'courier new', courier; font-weight: inherit;"&gt;Module VBScript&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;Function SendEmail(vEmailSubject)&lt;BR /&gt; &lt;BR /&gt; &lt;SPAN style="color: #ff00ff;"&gt;set v = ActiveDocument.Variables("vEmailSubject")&lt;/SPAN&gt;&lt;BR /&gt; Set emailObj&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = CreateObject("CDO.Message")&lt;BR /&gt;&lt;SPAN&gt; emailObj.From&amp;nbsp;&amp;nbsp;&amp;nbsp; = "&lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:Bob@cfg123.org"&gt;Bob@cfg123.org&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; emailObj.To&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = "&lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:Bob@cfg123.org"&gt;Bob@cfg123.org&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: green;"&gt;&lt;SPAN style="color: #ff00ff;"&gt;emailObj.Subject = v.GetContent.String&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;OL style="list-style-type: lower-alpha;"&gt;&lt;LI&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;emailObj.TextBody = "Test CDO"&lt;BR /&gt; &lt;BR /&gt; Set emailConfig = emailObj.Configuration&lt;BR /&gt; &lt;BR /&gt;&lt;SPAN&gt; emailConfig.Fields("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://schemas.microsoft.com/cdo/configuration/smtpserver" rel="nofollow" target="_blank"&gt;http://schemas.microsoft.com/cdo/configuration/smtpserver&lt;/A&gt;&lt;SPAN&gt;") = "10.21.20.72"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; emailConfig.Fields("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://schemas.microsoft.com/cdo/configuration/smtpserverport" rel="nofollow" target="_blank"&gt;http://schemas.microsoft.com/cdo/configuration/smtpserverport&lt;/A&gt;&lt;SPAN&gt;") = 25&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; emailConfig.Fields("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://schemas.microsoft.com/cdo/configuration/sendusing" rel="nofollow" target="_blank"&gt;http://schemas.microsoft.com/cdo/configuration/sendusing&lt;/A&gt;&lt;SPAN&gt;" &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;OL style="list-style-type: lower-alpha;"&gt;&lt;LI&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;emailObj.Send&lt;BR /&gt; &lt;BR /&gt; End Function &lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Jul 2018 15:59:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pass-field-value-to-Module-Macro/m-p/87898#M603631</guid>
      <dc:creator>dhborchardt</dc:creator>
      <dc:date>2018-07-02T15:59:11Z</dc:date>
    </item>
  </channel>
</rss>

