Func Createobject
# VBScript CreateObject Function
* * Complete VBScript Reference Manual](#)
* * *
The CreateObject function creates an object of a specified type.
### Syntax
CreateObject(servername.typename[,location])
| Parameter | Description |
| :--- | :--- |
| servername | Required. The name of the application providing this object. |
| typename | Required. The type or class of the object. |
| location | Optional. Where to create the object. |
## Examples
## Examples
Create a regular expression object:
txt="This is a beautiful day"
Set objReg=CreateObject("vbscript.regexp")
objReg.Pattern="i"
document.write(objReg.Replace(txt,"##"))
The output of the above example:
Th##s is a beautiful day
[Try it Β»](#)
* * Complete VBScript Reference Manual](#)
YouTip