IDatabaseSubstituteTemplateVarsEx Method |
This function will replace template variables in a string with the specified information, e.g. replace the <name> template variable with the text "SuperOffice AS". If you want to create your own template systems, you can access our substitution engine using this function. This will fill the values based on the logged in user.
This function will replace template variables in a string with the specified information, e.g. replace the <name> template variable with "SuperOffice AS". If you want to create your own template systems, you can access our substitution engine using this function. This will fill the values based on the associate provided.
Namespace: SuperOffice.COM.SuperOfficeDB
string SubstituteTemplateVarsEx( string SourceString, int lContactId, int lPersonId, int lProjectId, int lSelectionId = 0, int lAppointmentId = 0, int lDocumentId = 0, int lSaleId = 0, int lAssociateId = 0, bool bIsMailMergeDraft = false, bool bUseHtmlBrackets = false, bool bUrlEncode = false, bool bUseHtmlBreak = false )
Replace template variables
This text may be copied to the notepad, and saved as a *.vbs file. Remember to change the login information.
dim objSO set objSO = CreateObject("SuperOfficeDB.Database") enUrlEncodingANSI = 2 enUrlEncodingUnicode = 3 If not (objSO is nothing) Then objSO.Login "USERNAME", "PASSWORD" str = "Dear <atfn>, have <name> received our offer? " & vbCrLf & "Best regards <auth>" MsgBox objSO.SubstituteTemplateVars(str,2,2,1,1, False, False, False),, "Url encoding template variables false" MsgBox objSO.SubstituteTemplateVars(str,2,2,1,1, False, False, True),, "Url encoding template variables true" MsgBox objSO.SubstituteTemplateVarsEx (str, 2, 2, 1, 1, 0, 0, 0, 4, false, false, false, false),, "Url encoding template variables false" MsgBox objSO.SubstituteTemplateVarsEx (str, 2, 2, 1, 1, 0, 0, 0, 4, false, false, true, false),, "Url encoding template variables true" MsgBox objSO.SubstituteTemplateVarsUrlEncoding (str, 2, 2, 1, 1, 0, 0, 0, 4, false, false, enUrlEncodingANSI, false),, "Url encoding template variables ansi" MsgBox objSO.SubstituteTemplateVarsUrlEncoding (str, 2, 2, 1, 1, 0, 0, 0, 4, false, false, enUrlEncodingUnicode, false),, "Url encoding template variables unicode" else msgbox "unable to connect to database" end if set objso = nothing
[New Example]
dim objSO set objSO = CreateObject("SuperOfficeDB.Database") enUrlEncodingANSI = 2 enUrlEncodingUnicode = 3 If not (objSO is nothing) Then objSO.Login "USERNAME", "PASSWORD" str = "Dear <atfn>, have <name> received our offer? " & vbCrLf & "Best regards <auth>" MsgBox objSO.SubstituteTemplateVars(str,2,2,1,1, False, False, False),, "Url encoding template variables false" MsgBox objSO.SubstituteTemplateVars(str,2,2,1,1, False, False, True),, "Url encoding template variables true" MsgBox objSO.SubstituteTemplateVarsEx (str, 2, 2, 1, 1, 0, 0, 0, 4, false, false, false, false),, "Url encoding template variables false" MsgBox objSO.SubstituteTemplateVarsEx (str, 2, 2, 1, 1, 0, 0, 0, 4, false, false, true, false),, "Url encoding template variables true" MsgBox objSO.SubstituteTemplateVarsUrlEncoding (str, 2, 2, 1, 1, 0, 0, 0, 4, false, false, enUrlEncodingANSI, false),, "Url encoding template variables ansi" MsgBox objSO.SubstituteTemplateVarsUrlEncoding (str, 2, 2, 1, 1, 0, 0, 0, 4, false, false, enUrlEncodingUnicode, false),, "Url encoding template variables unicode" else msgbox "unable to connect to database" end if set objso = nothing