Print Preview ActiveX Active Users: 19 / Visits Today: 1477
Highest Active Users: 189
Print Preview ActiveX
Home | Profile | Register | Active Topics | Members | Search | FAQ | RSS
Save Password
Forgot your Password?

 All Forums
 Print Preview
 Help file
 Substitution - Function
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic: TextHeight - Function Topic Next Topic: ShowStatusBar - Property  


327 Posts

Posted - 07/24/2005 :  11:54:04  Show Profile
Function Substitution


This function performs simple macro substitution on a string.


Substitution ( strInString As String, colParams As Collection ) As String

Parameter         Description                        
  • strInString String to be processed.
  • colParams Set of parameters for substitution

    Simple macro substitution is performed on the string.

    The parameters are defined as a set of named string values. The function searches for keywords in the form %Key% in the InString. The value of Key is then used to retrieve a substitution from the Params collection. The associated string value then replaces the %Key%.

    The processed string is returned as the value of the function.


    To process a string:

    Dim Params as New Collection

    Params.Add "John Smith", "addressee"

    s1 = "Dear %addressee%" & vbLF & FileToString("letter.txt")
    s2 = Preview.Substitution (s1, Params)

    Come and visit :
    Go to Bottom of Page
      Previous Topic: TextHeight - Function Topic Next Topic: ShowStatusBar - Property  
     New Topic  Topic Locked
     Printer Friendly
    Jump To:
    Print Preview ActiveX © Mandix Go To Top Of Page
    This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000 Version 3.4.02