Please note, this is a STATIC archive of website www.w3schools.com from 05 May 2020, cach3.com does not collect or store any user information, there is no "phishing" involved.
THE WORLD'S LARGEST WEB DEVELOPER SITE

VBScript CreateObject Function

❮ Complete VBScript Reference

The CreateObject function creates an object of a specified type.

Syntax

CreateObject(servername.typename[,location])
Parameter Description
servername Required. The name of the application that provides the object
typename Required. The type/class of the object
location Optional. Where to create the object

Example

Example

Creating a regular expression object:

<%

txt="This is a beautiful day"
Set objReg=CreateObject("vbscript.regexp")
objReg.Pattern="i"
response.write(objReg.Replace(txt,"##"))

%>

The output of the code above will be:

Th##s is a beautiful day
Show Example »

❮ Complete VBScript Reference