Posted 15 June 2023, 10:10 am EST - Updated 15 June 2023, 10:15 am EST
Dear Collegues
I need help with my Code (VBscript) to load and insert a picture automaticly.
I’m working with ERP System (base Sql) integrated with C1ReportDesigner. Some tools of ERP execute scritps, for example to send directly email from the system, as the code below.
Dim conn
Dim prm
Public Sub main (prm)
prm.ExecutionResult = prm.Constants.EXECUTION_RESULT_FALSE
Set Me.prm = prm
Dim bytAccessType, avParameters
prm.TranslateNewToOldModelControl bytAccessType, avParameters
Dim inFoEmail
Dim strMessage, strSUbject, strCc, strSignature, strTo
Set ocnADO = CreateObject ("ADODB.Connection")
ocnADO.Open "DSN=" & Trim (prm.Database.Dsn) & ";Persist Security Info=true;Uid=" & Trim (prm.Database.UserName) & ";Pwd=" & Trim (prm.Database.Password) & ""
ocnADO.CommandTimeout = 0
'Before Send
If (UCase (avParameters(0)) = "B") Then
inFoEmail = prm.inFoEmail
' array
strMessage = inFoEmail(0)
strSubject = inFoEmail(1)
strCc = inFoEmail(2)
strSignature = inFoEmail(3)
strTo = inFoEmail(4)
'
'... personalization
'
strMessage = "Dear Customer </br></br> text : </br><br>" & inFoEmail(0) & "</br><br> text"
strSubject = "Signature Test"
strCc = "picture@gmail.com"
strSignature = ""
strTO = "image@gmail.com"
'Return info
inFoEmail(0) = strMessage
inFoEmail(1) = strSubject
inFoEmail(2) = strCc
inFoEmail(3) = strSignature
inFoEmail(4) = strTo
prm.inFoEmail = inFoEmail
prm.ExecutionResult = prm.Constants.EXECUTION_RESULT_TRUE
'After Send
ElseIf (UCase (avParameters(0)) = "E") Then
prm.ExecutionResult = prm.Constants.EXECUTION_RESULT_TRUE
End If
How to load an image through this script?
With Private Sub … Public Property … or just with a variable.
Which object and class do I have to use
Tks
Eduardo