by Rodolfo Gonzalez Ruiz (1 Submission)
Category: Object Oriented Programming (OOP)
Compatability: Visual Basic 3.0
Difficulty: Advanced
Date Added: Wed 3rd February 2021
Rating: (5 Votes)
At last!!! Something that nearly matches the great functinallity that macro substitution gives in Visual FoxPro through the & Command... in this case we simulate it using the Microsoft Script Control, which allows you to run VBSCRIPT code through the control's methods, simply passing it code as a string parameter.
Assumes
You must have the ScriptControl registered and available to your VB project... (named 'Microsoft Script Control 1.0' in the References section of Visual Basic) (its usual location is 'windows\system\msscript.ocx' or 'winnt\system32\msscript.ocx' accordingly).
Download VB Macro Substitution Simulation with the ScriptControl (2 KB)