Searches for a library among the libraries open in the application. Returns the index of the found library in the library collection of the application.
Applies to: Application object
[[Set] indexRet =] object.FindLib ( inLib ) |
The FindLib method syntax has these parts:
Part | Description |
object | Required. An expression that returns an object in the Applies to list. |
inLib |
Required. An expression that returns a Library object. |
indexRet | Optional. A Long type variable. |
If the specified library has not been found in the library collection of the application, the FindLib method returns 0. The inverse method for FindLib is the Lib method, which returns a library by its index in the library collection of the application.
This example contains an application-level script. The script closes the library if it's the second library in the library collection of the application.
Sub Close_if_2nd_Lib ( inLib As Library ) If thisApp.FindLib( inLib ) = 2 Then thisApp.CloseLib( inLib ) End If End Sub Close_if_2nd_Lib( thisApp.ActiveLibWnd.Library ) |
See Also |
CloseLib method, CreateNewLib method, FindLib method, Lib method, LibByName method, LibsNum method, OpenLib method, Library object |