vbs error Overflow

July 03, 2017, at 9:46 PM

I'm trying to send an email Outlook in HTML using CSS and HTML table, but I'm getting an error: an overflow on line 33. My old script worked without HTML, now I want to send in HTML. Can you help me to resolve it?

See below my code:

Const ForReading = 1
Const ForWriting = 2
Const ForAppending = 8
Const FileToBeUsed = "C:\link of my file"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile("C:\link of my file")
If objFile.Size > 0 Then
  Dim objCDO1, objCDO2
  Dim fso, f
  Set fso = CreateObject("Scripting.FileSystemObject")
  Set f = fso.OpenTextFile(FileToBeUsed, ForReading)
  Set objCDO1 = CreateObject("CDO.Message")
  'objCDO1.Textbody = "See the details of the file  ."&VbNewLine+vbnewline+vbnewline&"No more details"
  'objCDO1.Textbody = f.ReadAll
  strFileText = f.ReadAll
  arrFileText = Split(strFileText, vbCrLF) 'split the file content by line feed character
  For intArrCounter = 0 To UBound(arrFileText)
    ArrLineContent = Split(arrFileText(intArrCounter), "|")
    Code = ArrLineContent(0)
    Operator = ArrLineContent(1)
    CLIENT = ArrLineContent(2)
    MONTANT = ArrLineContent(3)
    CIN = ArrLineContent(4)
    NOM = ArrLineContent(5)
    PERIODE = ArrLineContent(6)
    HEURE = ArrLineContent(7)
    Dim cdohtml 
    cdohtml= "<HTML>"&_
      "<style type="&text/css&">"&_
      ".tg {border-collapse:collapse;border-spacing:0;}"&_
      ".tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:0px;overflow:hidden;word-break:normal;border-top-width:1px;border-bottom-width:1px;}"&_
      ".tg th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:0px;overflow:hidden;word-break:normal;border-top-width:1px;border-bottom-width:1px;}"&_
      ".tg .tg-4cee{background-color:#d91717;color:#000000;text-align:center}"&_
      ".tg .tg-g1w4{font-size:large;background-color:#d91717;color:#000000}"&_
      "<table class="&tg&" style="&undefined&";table-layout: fixed; width: 337px">""&_
      "<col style="&width&"&: 156px&">""&_
      "<col style="&width&"&: 181px&">""&_
      "<td class="&tg-g1w4&">Numéro Bordereau</td>"&_
      "<td class="&tg&"&-4cee&">" & Code & ""</td>"&_
      "<td class="&tg-g1w4&">Opération</td>"&_
      "<td class="&tg&"&-4cee&">" & Operator & ""</td>"&_
      "<td class="&tg-g1w4&">Client</td>"&_
      "<td class="&tg&"&-4cee&">" & CLIENT & ""</td>"&_
      "<td class="&tg-g1w4&">Montant</td>"&_
      "<td class="&tg&"&-4cee&">" & Code & ""</td>"&_
      "<td class="&tg-g1w4&">CIN</td>"&_
      "<td class="&tg&"&-4cee&">" & CIN & ""</td>"&_
      "<td class="&tg-g1w4&">Nom Porteur</td>"&_
      "<td class="&tg&"&-4cee&">" & NOM & ""</td>"&_
      "<td class="&tg-g1w4&">Date</td>"&_
      "<td class="&tg&"&-4cee&">" & PERIODE & ""</td>"&_
      "<td class="&tg-g1w4&">Heure</td>"&_
      "<td class="&tg&"&-4cee&">" & HEURE & ""</td>"&_
    objCDO1.HtmlBody = cdohtml
    'objCDO1.AddAttachment("C:\link of my file")
    objCDO1.To ="adr1@.com"
    objCDO1.From = "adr2@.com (CCP Stored Procedure Message)"
    objCDO1.Subject = "CCP Stored Procedure"
    objCDO1.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    objCDO1.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mysmtp"
    objCDO1.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration /smtpserverport") = 25
    'objCDO1.HTMLBody="Image <img src='C:\link of image\ENTETE.png'>"                                     
  Set cdohtml = Nothing
  Set objCDO1 = Nothing
  Set f       = Nothing
  Set fso     = Nothing
  WScript.Echo "no file"
End If
How to ship css?

How to ship css?

I'm using a third party lib, which apparently forces me put some css in my chord-diagramcomponent

Materialize CSS: Stacking cards responsively

Materialize CSS: Stacking cards responsively

I'm trying to build a layout in materialize CSS with many cards that fall into a responsive layout: Four cards in large displays (col l3), two in medium (col m6) and one in small (col s12)

Dynamics crm - use default CSS for custom HTML webresource

Dynamics crm - use default CSS for custom HTML webresource

There is lot's of tutorials on how to use custom webresources in dynamics CRM, I know

How to style signature links in Outlook for Gmail?

How to style signature links in Outlook for Gmail?

I'm creating an email signature in Microsoft OutlookI'm aware that the formatting will never be 100% consistent across all email readers, but I'd settle for the most used platforms in our company displaying them correctly: Outlook, Gmail and Apple Mail