Visio2002: Sample Code in Help Topic About SetFilterObjects Method Is Incorrect (299207)



The information in this article applies to:

  • Microsoft Visio 2002 Standard
  • Microsoft Visio 2002 Professional

This article was previously published under Q299207

SYMPTOMS

When you use the following sample code in the Microsoft Visio Developer Reference Help topic for the SetFilterObjects method
Dim objArray (2 * 2) As Long
objArray(1) = visTypeShape
objArray(2) = True
objArray(3) = visTypeGuide
objArray(4) = True
				
the code does not work as expected.

CAUSE

This behavior occurs because the sample code in the Help topic for the SetFilterObjects method is incorrect. The dimension statement creates an extra array element (objArray(0)). The SetFilterObjects method requires an array with the correct number of elements.

RESOLUTION

To resolve this issue, use the following code instead:
Dim objArray(1 To (2 * 2)) As Long
objArray(1) = visTypeShape
objArray(2) = True
objArray(3) = visTypeGuide
objArray(4) = True
				
NOTE: This array does not have an array element with the index of 0.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

Modification Type:MinorLast Reviewed:10/11/2006
Keywords:kbbug kbpending KB299207