Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I include a VBScript within my VB code? If so, how?

Status
Not open for further replies.

ri

Programmer
Nov 2, 2000
12
0
0
GB
Any help here would be much appreciated.

Thanks.
 
What are you looking to do? Steven Fowler, Principal
steve.fowler@fowlerconsulting.com
- Development, Training, and Consulting
wpe1.gif
 
You can add the VBScriptControl as a Component or as a Reference to your program: Go to the Projects menu and select e.g. References, then add MS Script Control.

When done you can declare and set a variable as your scriptcontrol:

Dim objSC as ScriptControl
Set objSC = New ScriptControl

From here on, you're an your own to perform whatever scripting function you like.

-----
The MS documentation on this control is rather trivial. For a more comprehensive source, I recommend you:

VBScript Programmer's Reference
Susanne Clarck, Antonio de Donatis, et. al.
WROX Press Inc.
ISBN: 1-861-00271-8
 
If you want to write the script in your program, set a reference to Microsoft Scripting Runtime and then you can do things like:

Dim fso as FileSystemObject

Simon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top