Chapter 2 -- 74
Programmer’s Guide
"
""
" DocObjects.Add
VT_DISPATCH or DocObject
Add( longDocObjectType,
strDocObjectName ).
Adds a new DocObject
object to the current document.
Return value: Returns a DocObject
object.
Parameters:
longDocObjectType RequiredVT_I4orLong
or
enumDocObject
. The type of object to add.
Thevaluecanbeoneofthefollowing:
lppxObjectText = 1
lppxObjectBarCode = 2
lppxObjectImage = 3
lppxObjectLine = 4
lppxObjectRectangle = 5
lppxObjectEllipse = 6
lppxObjectPolygon = 7
lppxObjectOblique = 8
lppxObjectRoundRect = 9
lppxObjectOLEObject = 10
strDocObjectName Optional VT_BSTR or String
.The
name of the object to add.
"
""
" DocObjects.Item
VTS_DISPATCH or DocObject
Item( varIndex ).
Returns a member of a collection, either by position or by name.
Note
If the value provided as Index does not match any existing
member of the collection, no object is returned.
Parameters:
varIndex Required VT_VARIANT or Variant
.Thenameor
index number of a member of the collection.
The index can be a numeric expression (a number from 1 to the
value of the collection’s Count property), a constant, or a string.
Note
If the value provided as Index doesn’t match any existing
member of the collection, an error occurs.
The Item method is the default method for collections. There-
fore, the following two lines of code are equivalent.
Object. DocObjects (1)
Object. DocObjects.Item(1)
Object
Methods