<?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 add a condition to macro that send a multiple reports in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/add-a-condition-to-macro-that-send-a-multiple-reports/m-p/1581310#M739731</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a report that is sent daily to different managers in the company with the speed violation of car fleet they have. This is a daily report and it works great, I need to add the number of alerts in the email subject and in the body email, so in the case, there are no alerts the manager knows before opening the PDF.&lt;/P&gt;&lt;P&gt;the object ID I want to use is called TX53&lt;/P&gt;&lt;P&gt;I leave the macro I use for the report&amp;nbsp;&lt;/P&gt;&lt;P&gt;' --------------------------------------------------------&lt;BR /&gt;'| Function: HtmlEncoding&lt;BR /&gt;' --------------------------------------------------------&lt;BR /&gt;Function HtmlEncoding (strInput)&lt;BR /&gt;strOutput = strInput&lt;BR /&gt;&lt;BR /&gt;'Lower-case Tilde Vowels&lt;BR /&gt;strOutput = Replace(strOutput, "á", "&amp;amp;aacute;")&lt;BR /&gt;strOutput = Replace(strOutput, "é", "&amp;amp;eacute;")&lt;BR /&gt;strOutput = Replace(strOutput, "í", "&amp;amp;iacute;")&lt;BR /&gt;strOutput = Replace(strOutput, "ó", "&amp;amp;oacute;")&lt;BR /&gt;strOutput = Replace(strOutput, "ú", "&amp;amp;uacute;")&lt;BR /&gt;&lt;BR /&gt;'Upper-case Tilde Vowels&lt;BR /&gt;strOutput = Replace(strOutput, "Á", "&amp;amp;Aacute;")&lt;BR /&gt;strOutput = Replace(strOutput, "É", "&amp;amp;Eacute;")&lt;BR /&gt;strOutput = Replace(strOutput, "Í", "&amp;amp;Iacute;")&lt;BR /&gt;strOutput = Replace(strOutput, "Ó", "&amp;amp;Oacute;")&lt;BR /&gt;strOutput = Replace(strOutput, "Ú", "&amp;amp;Uacute;")&lt;/P&gt;&lt;P&gt;HtmlEncoding = strOutput&lt;BR /&gt;End Function&lt;BR /&gt;' --------------------------------------------------------&lt;BR /&gt;'| Function: ReadTxtFile&lt;BR /&gt;'| Descripcion: Leer variable desde archivo de texto&lt;BR /&gt;' --------------------------------------------------------&lt;BR /&gt;Function ReadTxtFile (strFile)&lt;BR /&gt;Const ForReading = 1&lt;BR /&gt;Set objFSO = CreateObject("Scripting.FileSystemObject")&lt;BR /&gt;Set objFile = objFSO.OpenTextFile(Replace(ActiveDocument.GetPathName, "Reporte\companyname_Reporte-Diario-por-Gerencia.qvw", "") &amp;amp; "External\" &amp;amp; strFile, ForReading)&lt;BR /&gt;Do Until objFile.AtEndOfStream&lt;BR /&gt;strSearchString = objFile.ReadLine&lt;BR /&gt;Loop&lt;BR /&gt;objFile.Close&lt;BR /&gt;ReadTxtFile = strSearchString&lt;BR /&gt;End Function&lt;/P&gt;&lt;P&gt;' --------------------------------------------------------&lt;BR /&gt;'| Function: MyPrintPDFWithBullZip&lt;BR /&gt;'| Description: CreatePDF&amp;nbsp;&lt;BR /&gt;' --------------------------------------------------------&lt;BR /&gt;Sub PrintPDF (strReportFile, strReportID)&lt;BR /&gt;set obj = CreateObject("Bullzip.PdfSettings")&lt;BR /&gt;obj.SetValue "Output" , strReportFile&lt;BR /&gt;obj.SetValue "ConfirmOverwrite", "no"&lt;BR /&gt;obj.SetValue "ShowSaveAS", "never"&lt;BR /&gt;obj.SetValue "ShowSettings", "never"&lt;BR /&gt;obj.SetValue "ShowPDF", showFile&lt;BR /&gt;obj.SetValue "RememberLastFileName", "no"&lt;BR /&gt;obj.SetValue "RememberLastFolderName", "no"&lt;BR /&gt;obj.SetValue "ShowProgressFinished", "no"&lt;BR /&gt;obj.SetValue "ShowProgress", "no"&lt;BR /&gt;obj.WriteSettings True&lt;BR /&gt;&lt;BR /&gt;ActiveDocument.PrintReport(strReportID), "Bullzip PDF Printer", false&lt;BR /&gt;End Sub&lt;/P&gt;&lt;P&gt;' --------------------------------------------------------&lt;BR /&gt;'| Function: SendReport&lt;BR /&gt;'| Descripcion: Funcion principal.&lt;BR /&gt;' --------------------------------------------------------&lt;BR /&gt;Sub SendReport (strGerencia, strDestinatario)&lt;BR /&gt;ActiveDocument.ClearAll true&lt;BR /&gt;ActiveDocument.Variables("vGerencia").SetContent strGerencia, true&lt;BR /&gt;&lt;BR /&gt;'---------------------------------------------------------------------&lt;BR /&gt;' Date Variables&lt;BR /&gt;vFecha = date()-1&lt;BR /&gt;ActiveDocument.GetField("Calendar.Fecha").Select vFecha&lt;BR /&gt;vDiaMes = right("00" &amp;amp; day(vFecha),2)&lt;BR /&gt;set obj = ActiveDocument.GetSheetObject("TX62")&lt;BR /&gt;vDiaSemana = obj.GetCell(0,0).Text&lt;BR /&gt;vMes = right("00" &amp;amp; month(vFecha),2)&lt;BR /&gt;vAnio = Year(vFecha)&lt;BR /&gt;vSerial = vAnio &amp;amp; vMes &amp;amp; vDiaMes&lt;BR /&gt;&lt;BR /&gt;'---------------------------------------------------------------------&lt;BR /&gt;' PDF Report Configuration&lt;BR /&gt;strReportID = "RP01"&lt;BR /&gt;strReportName = "Codelco_Reporte-Diario_" &amp;amp; strGerencia &amp;amp; "_" &amp;amp; vSerial&lt;BR /&gt;strReportPath = Replace(ActiveDocument.GetPathName, "Companyname_Reporte-Diario-por-Gerencia.qvw", "") &amp;amp; "Historial\"&lt;BR /&gt;strReportFile = strReportPath &amp;amp; strReportName &amp;amp; ".pdf"&lt;BR /&gt;&lt;BR /&gt;'---------------------------------------------------------------------&lt;BR /&gt;' PDF Report Print&lt;BR /&gt;Call PrintPDF (strReportFile, strReportID)&lt;BR /&gt;ActiveDocument.GetApplication.Sleep 5000&lt;BR /&gt;&lt;BR /&gt;'---------------------------------------------------------------------&lt;BR /&gt;' Email Content&lt;BR /&gt;'"&amp;lt;meta http-equiv=" &amp;amp; chr(34) &amp;amp; "Content-Type" &amp;amp; chr(34) &amp;amp; " content=" &amp;amp; chr(34) &amp;amp; "text/html; charset=utf-8" &amp;amp; chr(34) &amp;amp; " /&amp;gt;" &amp;amp; _&lt;BR /&gt;strEmailSubject = "Companyname- Reporte Diario - " &amp;amp; strGerencia &amp;amp; " - " &amp;amp; vFecha&lt;BR /&gt;strEmailBody = "&amp;lt;!DOCTYPE html PUBLIC" &amp;amp; chr(34) &amp;amp; "-//W3C//DTD XHTML 1.0 Transitional//EN" &amp;amp; chr(34) &amp;amp; " " &amp;amp; chr(34) &amp;amp; "&lt;A href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" target="_blank"&gt;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&lt;/A&gt;" &amp;amp; chr(34) &amp;amp; "&amp;gt;" &amp;amp; _&lt;BR /&gt;"&amp;lt;html xmlns=" &amp;amp; chr(34) &amp;amp; "&lt;A href="http://www.w3.org/1999/xhtml" target="_blank"&gt;http://www.w3.org/1999/xhtml&lt;/A&gt;" &amp;amp; chr(34) &amp;amp; "&amp;gt;" &amp;amp; _&lt;BR /&gt;"&amp;lt;head&amp;gt;" &amp;amp; _&lt;BR /&gt;"&amp;lt;meta http-equiv=" &amp;amp; chr(34) &amp;amp; "Content-Type" &amp;amp; chr(34) &amp;amp; " content=" &amp;amp; chr(34) &amp;amp; "text/html" &amp;amp; chr(34) &amp;amp; " /&amp;gt;" &amp;amp; _&lt;BR /&gt;"&amp;lt;title&amp;gt;" &amp;amp; strEmailSubject &amp;amp; "&amp;lt;/title&amp;gt;" &amp;amp; _&lt;BR /&gt;"&amp;lt;meta name=" &amp;amp; chr(34) &amp;amp; "viewport" &amp;amp; chr(34) &amp;amp; " content=" &amp;amp; chr(34) &amp;amp; "width=device-width, initial-scale=1.0" &amp;amp; chr(34) &amp;amp; "/&amp;gt;" &amp;amp; _&lt;BR /&gt;"&amp;lt;/head&amp;gt;" &amp;amp; _&lt;BR /&gt;"&amp;lt;body&amp;gt;" &amp;amp; _&lt;BR /&gt;"Estimado(a),&amp;lt;br&amp;gt;" &amp;amp; _&lt;BR /&gt;"&amp;lt;br&amp;gt;Se adjunta reporte diario, " &amp;amp; strGerencia &amp;amp; ", correspondiente al d&amp;amp;iacute;a " &amp;amp; HtmlEncoding(vDiaSemana) &amp;amp; " " &amp;amp; vFecha &amp;amp; "." &amp;amp; _&lt;BR /&gt;"&amp;lt;/body&amp;gt;" &amp;amp; _&lt;BR /&gt;"&amp;lt;/html&amp;gt;"&lt;BR /&gt;&lt;BR /&gt;'---------------------------------------------------------------------&lt;BR /&gt;' Email Object&lt;BR /&gt;Set objEmail = CreateObject("CDO.Message")&lt;BR /&gt;Set msgConf = objEmail.Configuration.Fields&lt;/P&gt;&lt;P&gt;'---------------------------------------------------------------------&lt;BR /&gt;' SMTP server details&lt;BR /&gt;msgConf.Item("&lt;A href="http://schemas.microsoft.com/cdo/configuration/sendusing" target="_blank"&gt;http://schemas.microsoft.com/cdo/configuration/sendusing&lt;/A&gt;") = 2&lt;BR /&gt;msgConf.Item("&lt;A href="http://schemas.microsoft.com/cdo/configuration/smtpserver" target="_blank"&gt;http://schemas.microsoft.com/cdo/configuration/smtpserver&lt;/A&gt;") = "smtp.office365.com"&lt;BR /&gt;msgConf.Item("&lt;A href="http://schemas.microsoft.com/cdo/configuration/smtpusessl" target="_blank"&gt;http://schemas.microsoft.com/cdo/configuration/smtpusessl&lt;/A&gt;") = true&lt;BR /&gt;msgConf.Item("&lt;A href="http://schemas.microsoft.com/cdo/configuration/StartTLS" target="_blank"&gt;http://schemas.microsoft.com/cdo/configuration/StartTLS&lt;/A&gt;") = true&lt;BR /&gt;msgConf.Item("&lt;A href="http://schemas.microsoft.com/cdo/configuration/smtpserverport" target="_blank"&gt;http://schemas.microsoft.com/cdo/configuration/smtpserverport&lt;/A&gt;") = 25&lt;BR /&gt;msgConf.Item("&lt;A href="http://schemas.microsoft.com/cdo/configuration/smtpauthenticate" target="_blank"&gt;http://schemas.microsoft.com/cdo/configuration/smtpauthenticate&lt;/A&gt;") = 1&lt;BR /&gt;msgConf.Item("&lt;A href="http://schemas.microsoft.com/cdo/configuration/sendusername" target="_blank"&gt;http://schemas.microsoft.com/cdo/configuration/sendusername&lt;/A&gt;") = "xxx@xxxx.xx"&lt;BR /&gt;msgConf.Item("&lt;A href="http://schemas.microsoft.com/cdo/configuration/sendpassword" target="_blank"&gt;http://schemas.microsoft.com/cdo/configuration/sendpassword&lt;/A&gt;") = "xxxxxxxxxxxx"&lt;BR /&gt;msgConf.Update&lt;/P&gt;&lt;P&gt;objEmail.To = strDestinatario&lt;BR /&gt;objEmail.BCC = "xxx@xxx.xx"&lt;BR /&gt;objEmail.From = "send@report.com"&lt;BR /&gt;objEmail.Subject = strEmailSubject&lt;BR /&gt;objEmail.HtmlBody = strEmailBody&lt;BR /&gt;objEmail.AddAttachment strReportFile&lt;BR /&gt;&lt;BR /&gt;'---------------------------------------------------------------------&lt;BR /&gt;' Send Email&lt;BR /&gt;objEmail.Send&lt;BR /&gt;Set msgConf = Nothing&lt;BR /&gt;Set objEmail = Nothing&lt;BR /&gt;End Sub&lt;/P&gt;&lt;P&gt;' --------------------------------------------------------&lt;BR /&gt;'| Function: Main&lt;BR /&gt;'| Descripcion: Instruccion principal del reporte&lt;BR /&gt;' --------------------------------------------------------&lt;/P&gt;&lt;P&gt;Sub Main&lt;BR /&gt;vSendMail = ReadTxtFile("SendMail.txt")&lt;BR /&gt;If vSendMail = 1 Then&lt;BR /&gt;Call SendReport("SERVICIOS Y SUMINISTROS","xxx@xxx.xx")&lt;BR /&gt;Call SendReport("GERENCIA HOSPITAL DE COBRE","xxx@xxx.xx")&lt;BR /&gt;Call SendReport("GERENCIA GENERAL","xxx@xxx.xx")&lt;BR /&gt;Call SendReport("REFINERIA","xxx@xxx.xx")&lt;BR /&gt;Call SendReport("RECURSOS MINEROS Y DESARROLLO","xxx@xxx.xx")&lt;BR /&gt;Call SendReport("RECURSOS HUMANOS","xxx@xxx.xx")&lt;BR /&gt;Call SendReport("PROYECTOS","xxx@xxx.xx")&lt;BR /&gt;Call SendReport("GERENCIA OPERACIONES","xxx@xxx.xx")&lt;BR /&gt;Call SendReport("MINA","xxx@xxx.xx")&lt;BR /&gt;Call SendReport("FUNDICION","xxx@xxx.xx")&lt;BR /&gt;Call SendReport("EXTRACCION Y LIXIVIACION","xxx@xxx.xx")&lt;BR /&gt;Call SendReport("CONCENTRADORA","xxx@xxx.xx")&lt;BR /&gt;Call SendReport("ADMINISTRACION","xxx@xxx.xx")&lt;BR /&gt;Call SendReport("SUSTENTABILIDAD Y ASUNTOS EXTERNOS","xxx@xxx.xx")&lt;BR /&gt;Call SendReport("SEGURIDAD Y SALUD OCUPACIONAL","xxx@xxx.xx")&lt;BR /&gt;Call SendReport("GG CONSEJERIA JURIDICA","xxx@xxx.xx")&lt;BR /&gt;End If&lt;BR /&gt;End Sub&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for the replay.&lt;/P&gt;&lt;P&gt;NRC&lt;/P&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator>wisetrackchile</dc:creator>
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>add a condition to macro that send a multiple reports</title>
      <link>https://community.qlik.com/t5/QlikView/add-a-condition-to-macro-that-send-a-multiple-reports/m-p/1581310#M739731</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a report that is sent daily to different managers in the company with the speed violation of car fleet they have. This is a daily report and it works great, I need to add the number of alerts in the email subject and in the body email, so in the case, there are no alerts the manager knows before opening the PDF.&lt;/P&gt;&lt;P&gt;the object ID I want to use is called TX53&lt;/P&gt;&lt;P&gt;I leave the macro I use for the report&amp;nbsp;&lt;/P&gt;&lt;P&gt;' --------------------------------------------------------&lt;BR /&gt;'| Function: HtmlEncoding&lt;BR /&gt;' --------------------------------------------------------&lt;BR /&gt;Function HtmlEncoding (strInput)&lt;BR /&gt;strOutput = strInput&lt;BR /&gt;&lt;BR /&gt;'Lower-case Tilde Vowels&lt;BR /&gt;strOutput = Replace(strOutput, "á", "&amp;amp;aacute;")&lt;BR /&gt;strOutput = Replace(strOutput, "é", "&amp;amp;eacute;")&lt;BR /&gt;strOutput = Replace(strOutput, "í", "&amp;amp;iacute;")&lt;BR /&gt;strOutput = Replace(strOutput, "ó", "&amp;amp;oacute;")&lt;BR /&gt;strOutput = Replace(strOutput, "ú", "&amp;amp;uacute;")&lt;BR /&gt;&lt;BR /&gt;'Upper-case Tilde Vowels&lt;BR /&gt;strOutput = Replace(strOutput, "Á", "&amp;amp;Aacute;")&lt;BR /&gt;strOutput = Replace(strOutput, "É", "&amp;amp;Eacute;")&lt;BR /&gt;strOutput = Replace(strOutput, "Í", "&amp;amp;Iacute;")&lt;BR /&gt;strOutput = Replace(strOutput, "Ó", "&amp;amp;Oacute;")&lt;BR /&gt;strOutput = Replace(strOutput, "Ú", "&amp;amp;Uacute;")&lt;/P&gt;&lt;P&gt;HtmlEncoding = strOutput&lt;BR /&gt;End Function&lt;BR /&gt;' --------------------------------------------------------&lt;BR /&gt;'| Function: ReadTxtFile&lt;BR /&gt;'| Descripcion: Leer variable desde archivo de texto&lt;BR /&gt;' --------------------------------------------------------&lt;BR /&gt;Function ReadTxtFile (strFile)&lt;BR /&gt;Const ForReading = 1&lt;BR /&gt;Set objFSO = CreateObject("Scripting.FileSystemObject")&lt;BR /&gt;Set objFile = objFSO.OpenTextFile(Replace(ActiveDocument.GetPathName, "Reporte\companyname_Reporte-Diario-por-Gerencia.qvw", "") &amp;amp; "External\" &amp;amp; strFile, ForReading)&lt;BR /&gt;Do Until objFile.AtEndOfStream&lt;BR /&gt;strSearchString = objFile.ReadLine&lt;BR /&gt;Loop&lt;BR /&gt;objFile.Close&lt;BR /&gt;ReadTxtFile = strSearchString&lt;BR /&gt;End Function&lt;/P&gt;&lt;P&gt;' --------------------------------------------------------&lt;BR /&gt;'| Function: MyPrintPDFWithBullZip&lt;BR /&gt;'| Description: CreatePDF&amp;nbsp;&lt;BR /&gt;' --------------------------------------------------------&lt;BR /&gt;Sub PrintPDF (strReportFile, strReportID)&lt;BR /&gt;set obj = CreateObject("Bullzip.PdfSettings")&lt;BR /&gt;obj.SetValue "Output" , strReportFile&lt;BR /&gt;obj.SetValue "ConfirmOverwrite", "no"&lt;BR /&gt;obj.SetValue "ShowSaveAS", "never"&lt;BR /&gt;obj.SetValue "ShowSettings", "never"&lt;BR /&gt;obj.SetValue "ShowPDF", showFile&lt;BR /&gt;obj.SetValue "RememberLastFileName", "no"&lt;BR /&gt;obj.SetValue "RememberLastFolderName", "no"&lt;BR /&gt;obj.SetValue "ShowProgressFinished", "no"&lt;BR /&gt;obj.SetValue "ShowProgress", "no"&lt;BR /&gt;obj.WriteSettings True&lt;BR /&gt;&lt;BR /&gt;ActiveDocument.PrintReport(strReportID), "Bullzip PDF Printer", false&lt;BR /&gt;End Sub&lt;/P&gt;&lt;P&gt;' --------------------------------------------------------&lt;BR /&gt;'| Function: SendReport&lt;BR /&gt;'| Descripcion: Funcion principal.&lt;BR /&gt;' --------------------------------------------------------&lt;BR /&gt;Sub SendReport (strGerencia, strDestinatario)&lt;BR /&gt;ActiveDocument.ClearAll true&lt;BR /&gt;ActiveDocument.Variables("vGerencia").SetContent strGerencia, true&lt;BR /&gt;&lt;BR /&gt;'---------------------------------------------------------------------&lt;BR /&gt;' Date Variables&lt;BR /&gt;vFecha = date()-1&lt;BR /&gt;ActiveDocument.GetField("Calendar.Fecha").Select vFecha&lt;BR /&gt;vDiaMes = right("00" &amp;amp; day(vFecha),2)&lt;BR /&gt;set obj = ActiveDocument.GetSheetObject("TX62")&lt;BR /&gt;vDiaSemana = obj.GetCell(0,0).Text&lt;BR /&gt;vMes = right("00" &amp;amp; month(vFecha),2)&lt;BR /&gt;vAnio = Year(vFecha)&lt;BR /&gt;vSerial = vAnio &amp;amp; vMes &amp;amp; vDiaMes&lt;BR /&gt;&lt;BR /&gt;'---------------------------------------------------------------------&lt;BR /&gt;' PDF Report Configuration&lt;BR /&gt;strReportID = "RP01"&lt;BR /&gt;strReportName = "Codelco_Reporte-Diario_" &amp;amp; strGerencia &amp;amp; "_" &amp;amp; vSerial&lt;BR /&gt;strReportPath = Replace(ActiveDocument.GetPathName, "Companyname_Reporte-Diario-por-Gerencia.qvw", "") &amp;amp; "Historial\"&lt;BR /&gt;strReportFile = strReportPath &amp;amp; strReportName &amp;amp; ".pdf"&lt;BR /&gt;&lt;BR /&gt;'---------------------------------------------------------------------&lt;BR /&gt;' PDF Report Print&lt;BR /&gt;Call PrintPDF (strReportFile, strReportID)&lt;BR /&gt;ActiveDocument.GetApplication.Sleep 5000&lt;BR /&gt;&lt;BR /&gt;'---------------------------------------------------------------------&lt;BR /&gt;' Email Content&lt;BR /&gt;'"&amp;lt;meta http-equiv=" &amp;amp; chr(34) &amp;amp; "Content-Type" &amp;amp; chr(34) &amp;amp; " content=" &amp;amp; chr(34) &amp;amp; "text/html; charset=utf-8" &amp;amp; chr(34) &amp;amp; " /&amp;gt;" &amp;amp; _&lt;BR /&gt;strEmailSubject = "Companyname- Reporte Diario - " &amp;amp; strGerencia &amp;amp; " - " &amp;amp; vFecha&lt;BR /&gt;strEmailBody = "&amp;lt;!DOCTYPE html PUBLIC" &amp;amp; chr(34) &amp;amp; "-//W3C//DTD XHTML 1.0 Transitional//EN" &amp;amp; chr(34) &amp;amp; " " &amp;amp; chr(34) &amp;amp; "&lt;A href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" target="_blank"&gt;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&lt;/A&gt;" &amp;amp; chr(34) &amp;amp; "&amp;gt;" &amp;amp; _&lt;BR /&gt;"&amp;lt;html xmlns=" &amp;amp; chr(34) &amp;amp; "&lt;A href="http://www.w3.org/1999/xhtml" target="_blank"&gt;http://www.w3.org/1999/xhtml&lt;/A&gt;" &amp;amp; chr(34) &amp;amp; "&amp;gt;" &amp;amp; _&lt;BR /&gt;"&amp;lt;head&amp;gt;" &amp;amp; _&lt;BR /&gt;"&amp;lt;meta http-equiv=" &amp;amp; chr(34) &amp;amp; "Content-Type" &amp;amp; chr(34) &amp;amp; " content=" &amp;amp; chr(34) &amp;amp; "text/html" &amp;amp; chr(34) &amp;amp; " /&amp;gt;" &amp;amp; _&lt;BR /&gt;"&amp;lt;title&amp;gt;" &amp;amp; strEmailSubject &amp;amp; "&amp;lt;/title&amp;gt;" &amp;amp; _&lt;BR /&gt;"&amp;lt;meta name=" &amp;amp; chr(34) &amp;amp; "viewport" &amp;amp; chr(34) &amp;amp; " content=" &amp;amp; chr(34) &amp;amp; "width=device-width, initial-scale=1.0" &amp;amp; chr(34) &amp;amp; "/&amp;gt;" &amp;amp; _&lt;BR /&gt;"&amp;lt;/head&amp;gt;" &amp;amp; _&lt;BR /&gt;"&amp;lt;body&amp;gt;" &amp;amp; _&lt;BR /&gt;"Estimado(a),&amp;lt;br&amp;gt;" &amp;amp; _&lt;BR /&gt;"&amp;lt;br&amp;gt;Se adjunta reporte diario, " &amp;amp; strGerencia &amp;amp; ", correspondiente al d&amp;amp;iacute;a " &amp;amp; HtmlEncoding(vDiaSemana) &amp;amp; " " &amp;amp; vFecha &amp;amp; "." &amp;amp; _&lt;BR /&gt;"&amp;lt;/body&amp;gt;" &amp;amp; _&lt;BR /&gt;"&amp;lt;/html&amp;gt;"&lt;BR /&gt;&lt;BR /&gt;'---------------------------------------------------------------------&lt;BR /&gt;' Email Object&lt;BR /&gt;Set objEmail = CreateObject("CDO.Message")&lt;BR /&gt;Set msgConf = objEmail.Configuration.Fields&lt;/P&gt;&lt;P&gt;'---------------------------------------------------------------------&lt;BR /&gt;' SMTP server details&lt;BR /&gt;msgConf.Item("&lt;A href="http://schemas.microsoft.com/cdo/configuration/sendusing" target="_blank"&gt;http://schemas.microsoft.com/cdo/configuration/sendusing&lt;/A&gt;") = 2&lt;BR /&gt;msgConf.Item("&lt;A href="http://schemas.microsoft.com/cdo/configuration/smtpserver" target="_blank"&gt;http://schemas.microsoft.com/cdo/configuration/smtpserver&lt;/A&gt;") = "smtp.office365.com"&lt;BR /&gt;msgConf.Item("&lt;A href="http://schemas.microsoft.com/cdo/configuration/smtpusessl" target="_blank"&gt;http://schemas.microsoft.com/cdo/configuration/smtpusessl&lt;/A&gt;") = true&lt;BR /&gt;msgConf.Item("&lt;A href="http://schemas.microsoft.com/cdo/configuration/StartTLS" target="_blank"&gt;http://schemas.microsoft.com/cdo/configuration/StartTLS&lt;/A&gt;") = true&lt;BR /&gt;msgConf.Item("&lt;A href="http://schemas.microsoft.com/cdo/configuration/smtpserverport" target="_blank"&gt;http://schemas.microsoft.com/cdo/configuration/smtpserverport&lt;/A&gt;") = 25&lt;BR /&gt;msgConf.Item("&lt;A href="http://schemas.microsoft.com/cdo/configuration/smtpauthenticate" target="_blank"&gt;http://schemas.microsoft.com/cdo/configuration/smtpauthenticate&lt;/A&gt;") = 1&lt;BR /&gt;msgConf.Item("&lt;A href="http://schemas.microsoft.com/cdo/configuration/sendusername" target="_blank"&gt;http://schemas.microsoft.com/cdo/configuration/sendusername&lt;/A&gt;") = "xxx@xxxx.xx"&lt;BR /&gt;msgConf.Item("&lt;A href="http://schemas.microsoft.com/cdo/configuration/sendpassword" target="_blank"&gt;http://schemas.microsoft.com/cdo/configuration/sendpassword&lt;/A&gt;") = "xxxxxxxxxxxx"&lt;BR /&gt;msgConf.Update&lt;/P&gt;&lt;P&gt;objEmail.To = strDestinatario&lt;BR /&gt;objEmail.BCC = "xxx@xxx.xx"&lt;BR /&gt;objEmail.From = "send@report.com"&lt;BR /&gt;objEmail.Subject = strEmailSubject&lt;BR /&gt;objEmail.HtmlBody = strEmailBody&lt;BR /&gt;objEmail.AddAttachment strReportFile&lt;BR /&gt;&lt;BR /&gt;'---------------------------------------------------------------------&lt;BR /&gt;' Send Email&lt;BR /&gt;objEmail.Send&lt;BR /&gt;Set msgConf = Nothing&lt;BR /&gt;Set objEmail = Nothing&lt;BR /&gt;End Sub&lt;/P&gt;&lt;P&gt;' --------------------------------------------------------&lt;BR /&gt;'| Function: Main&lt;BR /&gt;'| Descripcion: Instruccion principal del reporte&lt;BR /&gt;' --------------------------------------------------------&lt;/P&gt;&lt;P&gt;Sub Main&lt;BR /&gt;vSendMail = ReadTxtFile("SendMail.txt")&lt;BR /&gt;If vSendMail = 1 Then&lt;BR /&gt;Call SendReport("SERVICIOS Y SUMINISTROS","xxx@xxx.xx")&lt;BR /&gt;Call SendReport("GERENCIA HOSPITAL DE COBRE","xxx@xxx.xx")&lt;BR /&gt;Call SendReport("GERENCIA GENERAL","xxx@xxx.xx")&lt;BR /&gt;Call SendReport("REFINERIA","xxx@xxx.xx")&lt;BR /&gt;Call SendReport("RECURSOS MINEROS Y DESARROLLO","xxx@xxx.xx")&lt;BR /&gt;Call SendReport("RECURSOS HUMANOS","xxx@xxx.xx")&lt;BR /&gt;Call SendReport("PROYECTOS","xxx@xxx.xx")&lt;BR /&gt;Call SendReport("GERENCIA OPERACIONES","xxx@xxx.xx")&lt;BR /&gt;Call SendReport("MINA","xxx@xxx.xx")&lt;BR /&gt;Call SendReport("FUNDICION","xxx@xxx.xx")&lt;BR /&gt;Call SendReport("EXTRACCION Y LIXIVIACION","xxx@xxx.xx")&lt;BR /&gt;Call SendReport("CONCENTRADORA","xxx@xxx.xx")&lt;BR /&gt;Call SendReport("ADMINISTRACION","xxx@xxx.xx")&lt;BR /&gt;Call SendReport("SUSTENTABILIDAD Y ASUNTOS EXTERNOS","xxx@xxx.xx")&lt;BR /&gt;Call SendReport("SEGURIDAD Y SALUD OCUPACIONAL","xxx@xxx.xx")&lt;BR /&gt;Call SendReport("GG CONSEJERIA JURIDICA","xxx@xxx.xx")&lt;BR /&gt;End If&lt;BR /&gt;End Sub&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for the replay.&lt;/P&gt;&lt;P&gt;NRC&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/add-a-condition-to-macro-that-send-a-multiple-reports/m-p/1581310#M739731</guid>
      <dc:creator>wisetrackchile</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
  </channel>
</rss>

