Visual Basic Keywords Omitted From VB Script | HTML Goodies

Visual Basic Keywords Omitted From VB Script

Written By
Rick Darnell
Rick Darnell
Jan 13, 2005
4 minute read

from Special Edition Using HTML 4:

VB Script Keyword Reference











































































































































































































































































































































































































































































































































































































































































































































Keyword/FeatureDescription
Array Handling
Option BaseDeclares default lower bound
Arrays with lower bound <> 0All arrays must have 0 lower bound
Clipboard
Clipboard objectProvides access to the clipboard
ClearClears the contents of the clipboard
GetFormatDetermines format of clipboard object
GetDataReturns data from the clipboard
SetDataStores data in the clipboard
GetTextReturns text from the clipboard
SetTextStores text in the clipboard
Collection
AddAdds an item to a collection
CountReturns number of items in collection
ItemReturns an item from a collection
Remove
Removes an item from a collection
Access collections using ! characterAccesses a collection with !
Conditional Compilation
#ConstDefines a compiler constant
#If…Then…#ElseConditional compilation
Constants/Literals
ConstDefines a constant
All intrinsicPredefined constants such as vbOK constants
Exponent-basedReal numbers using exponents real number
Trailing data type characters
Defines data types implicitly
Control Flow
DoEvents
Yields execution to Windows
GoSub…ReturnBranches to a label in a procedure
GoToGoes to a label in a procedure
On Error GoToGoes to a label on an error
On…GoSubBranches to a label on an index
On…GoToGoes to a label on an index
Line numbersLine numbers
Line labels
Labels define GoTo/GoSub targets
With…End WithProvides easy access to an object
Conversion
Chr$Returns a character from an ASCII code
Hex$Returns string hex from a number
Oct$
Returns string octal from a number
CcurConverts expression to currency
CvarConverts expression to a variant
CVDateConverts an expression to a date
FormatFormats a string
Format$Formats a string
StrReturns a string form of a number
Str$
Returns a string form of a number
ValReturns a number from a string
Data Types
All intrinsic data types except variantData types such as Date
Type…End TypeDefines user-defined data type
Date/Time
Date statementReturns the current date
Time statementReturns the current time
Date$Returns the current date
Time$Returns the current time
TimerReturns seconds elapsed since midnight
DDE
LinkExecuteSends command during DDE conversation
LinkPoke
Sends data during a DDE conversation
LinkRequestReceives data during DDE conversation
LinkSendSends data during a DDE conversation
Debugging
Debug.PrintPrints to the debugging window
EndShuts down the application
StopStops the application
Declaration
DeclareDeclares a DLL
Property GetDefines a user-defined class
Property LetDefines a user-defined class
Property Set
Defines a user-defined class
PublicDeclares a public variable
PrivateDeclares a private variable
ParamArrayAccepts a variable number of arguments
OptionalSpecifies an optional argument
NewCreates a new object
Error Handling
ErlReturns the line number of an error
ErrorReturns an error message
Error$
Returns an error message
On Error…ResumeEnables error handling
ResumeResumes after an error
Resume NextResumes after an error
File Input/Output
AllOpens, reads, writes, and closes files
Financial
All financialFinancial function such as Rate functions.
Graphics
ClsClears the screen
CircleDraws a circle
Line
Draws a line
PointDraws a point
PsetChanges a point’s color
ScaleDefines the coordinate system
PrintPrints to a file
SpcPosition output using Print
TabInserts a tab character
TextHeight
Returns height of a text string
TextWidthReturns width of a text string
LoadPictureLoads a picture from disk
SavePictureSaves a picture to disk
QBColorReturns an RGB color code
RGBCombines RGB color codes
Manipulating Objects
ArrangeArranges windows
ZorderChanges z-order of windows
SetFocus
Sets focus to a window
InputBox$Prompts the user for a string
DragBegins a drag-and-drop operation
HideHides a form
ShowShows a form
LoadLoads a form
UnloadUnloads a form
Move
Moves a form
PrintFormPrints a form
RefreshRepaints a form
AddItemAdds item to list box
RemoveItemRemoves item from a list box
Miscellaneous
EnvironReturns the user’s environment
Environ$Returns the user’s environment
SendKeysSends keystrokes to a window
Command
Returns the command line parameters
Command$Returns the command line parameters
AppActivateActivates an application’s window
ShellLaunches another program
BeepBeeps the speaker
Object Manipulation
GetObjectReturns an OLE object from a file
TypeOfReturns the type of an object
Operators
LikeCompares to strings
Options
def typeSets default data type for variables
Option BaseSets default lower bound for arrays
Option Compare
Defines default comparison method
Option PrivateDefines default scope module
Printing
TextHeightReturns height of a text string
TextWidthReturns width of a text string
EndDocTerminates a print operation
NewPageEjects the current page
PrintFormPrints a form
Strings
All fixed-lengthStrings with a fixed length
LCase$Converts a string to lowercase
UCase$
Converts a string to uppercase
LsetLeft-aligns a string
RsetRight-aligns a string
Space$Pads a string with spaces
String$Pads a string with a character
FormatFormats a string
Format$Formats a string
Left$
Returns left portion of a string
Mid$Returns middle portion of a string
Right$Returns right portion of a string
Mid StatementReplaces a portion of a string
Trim$Removes leading and trailing spaces
LTrim$Removes leading spaces from a string
RTrim$Removes trailing spaces from a string
StrConv
Performs various conversions
Using Classes
TypeName
Defines a user-defined class
Optional Arguments
IsMissing
Indicates missing optional argument



from Special Edition Using HTML 4:


VB Script Keyword Reference


by Rick Darnell


© Copyright Macmillan Computer Publishing. All
rights reserved.

HTML Goodies Logo

The original home of HTML tutorials. HTMLGoodies is a website dedicated to publishing tutorials that cover every aspect of being a web developer. We cover programming and web development tutorials on languages and technologies such as HTML, JavaScript, and CSS. In addition, our articles cover web frameworks like Angular and React.JS, as well as popular Content Management Systems (CMS) that include WordPress, Drupal, and Joomla. Website development platforms like Shopify, Squarespace, and Wix are also featured. Topics related to solid web design and Internet Marketing also find a home on HTMLGoodies, as we discuss UX/UI Design, Search Engine Optimization (SEO), and web dev best practices.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.