The Set CustomBylndex Method

This method sets the custom property field and value based upon an index value. The method returns nothing, and has the following syntax:

object.SetCustomByIndex Index, Key, Value

Table 21-12 details this method's parameters.

Table 21-12. SetCustomByIndex Method Parameters

Name

Data Type

Description

Index

Long

The index value of the custom property field; this index can be from zero to the number of custom properties minus one.

Key

String

The name of the custom property to get.

Value

String

The variable to hold the value of the custom property.

The following example illustrates iterating through all the custom property fields and changing each custom property field using an index:

Public Sub TestSetCustomByIndex() Dim Index As Long Dim CustomKey As String Dim CustomValue As String

'iterate all custom properties of drawing For Index = 0 To ThisDrawing.SummaryInfo.NumCustomInfo - 1 ThisDrawing.SummaryInfo.GetCustomByIndex Index, CustomKey, CustomValue MsgBox "Key = " & CustomKey & vbCrLf & _ "Value = " & CustomValue Next Index End Sub

0 0

Post a comment