Microsoft KB Archive/299207

= Visio2002: Sample Code in Help Topic About SetFilterObjects Method Is Incorrect =

Article ID: 299207

Article Last Modified on 10/11/2006

-

APPLIES TO


 * Microsoft Visio 2002 Standard Edition
 * Microsoft Visio 2002 Professional Edition

-



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.

Additional query words: codeblock vb vba vbe Visio SetFilterObjects Developer Help Array

Keywords: kbbug kbpending KB299207

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.