Once upon a time, people identified the god Neptune as the source of storms at sea. Today we call these storms hurricanes. The only people who still call hurricanes acts of god are the people who write insurance forms.
Sub Window_Onload
Msgbox "The application has started."
End Sub
Refresh
Sub RunScript_Refresh
Location.Reload(True)
End Sub
Change the Cursor
Sub RunScript_Cursor
document.body.style.cursor = "wait"
End Sub
Copy To Clipboard
Sub RunScript_Copy
strCopy = BasicTextArea.Value
document.parentwindow.clipboardData.SetData "text", strCopy
End Sub
Paste From Clipboard
Sub RunScript_Paste
DataArea.InnerHTML = document.parentwindow.clipboardData.GetData("text")
End Sub
Disable
Sub RunScript_Disable
CONTROLID.Disabled = False
End Sub
Confirmation Box
Sub RunScript_Confirmation
blnAnswer = window.confirm("Are you sure you want to continue?")
If blnAnswer Then
Msgbox "You clicked the OK button"
Else
Msgbox "You clicked the Cancel button."
End If
End Sub
Prompt
Sub RunScript_Prompt
strAnswer = window.prompt("Please enter the domain name.", "599CD.com")
If IsNull(strAnswer) Then
Msgbox "You clicked the Cancel button"
Else
Msgbox "You entered: " & strAnswer
End If
End Sub
Display Data in a different window
Sub RunScript_IE
Set objIE = CreateObject("InternetExplorer.Application")
objIE.Navigate("about:blank")
objIE.ToolBar = 0
objIE.StatusBar = 0
Set objDoc = objIE.Document.Body
strHTML = "<B>This information is displayed in a separate window.</B>"
objDoc.InnerHTML = strHTML
objIE.Visible = True
End Sub
Print
Sub RunScript_Print
Window.Print()
End Sub
Save to .htm
Sub RunScript_Save
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CreateTextFile("test.htm")
Set objFile = objFSO.OpenTextFile("test.htm", 2)
objFile.WriteLine DataArea.InnerHTML
objFile.Close
End Sub
Timer
Sub Window_OnLoad
iTimerID = window.setInterval("RunScript", 5000, "VBScript")
End Sub
Tooltip
Sub RunScript_Tooltip
Tooltip.Title = "You successfully changed the tooltip."
End Sub
Quit
Sub RunScript_Quit
Window.Close
End Sub
You can use these in combination to produce some dynamic results.