STATEMENT: With ... End With
any legal code
Implemented in version 5.0
statement allows you to execute code on the named object. It is very important to understand that you can only specify a single object to be acted upon. You cannot list several objects.
You can nest
statements inside of other
statements or inside other conditional statements, such as an
. However, do not jump into or out of
With ... End With
blocks of code. The problem is that either the
portion of the statement may not be executed and this could cause errors or generate erroneous results.
Between the object name and
, you may place any legal block of VBScript code. For example, you could place statements assigning values to the properties of the designated object, as shown below.
Rem assign properties
.CatName = "Amy"
.CatAge = 3
.CatColor = "black, orange, white"
Copyright 1999-2004 by Infinite Software Solutions, Inc. All rights reserved.