CreateObject Method Example

CreateObject Method Example

This VBScript example utilizes the Open event of the item to access Microsoft Internet Explorer and display the Microsoft Web page.

Sub Item_Open()
   Set Web = CreateObject("InternetExplorer.Application")
   Web.Visible = TRUE
   Web.Navigate "www.microsoft.com"
End Sub

This VBScript example utilizes the Click event of a CommandButton on the item to access Microsoft Word and open a document on the root directory named "Resume.doc".

Sub CommandButton1_Click()
    Set Word = CreateObject("Word.Application")
    Word.Visible = TRUE
    Word.Documents.Open("C:\Resume.doc")
End Sub