'MacroName:CloseAuthorities 'MacroDescription:Closes all authority windows (records and lists). ' ' This macro was written by Walter F. Nickeson, ' University of Rochester, Rochester, NY ' wnickeson@library.rochester.edu ' ' Last updated: 22 June 2005. ' Check for the latest versions of this and my other macros at ' http://docushare.lib.rochester.edu/docushare/dsweb/View/Collection-2556 ' Please e-mail me with bug reports or to suggest improvements. ' ' Works in Connexion client 2.10. ' '*************************************************************** ' How it works: This macro closes all open authority records and ' lists. '*************************************************************** Option Explicit Sub Main Dim CS As Object Set CS = CreateObject("Connex.Client") Dim CountOfWindows% Dim TypeOfWindow% Dim Bool Dim i As Integer ' Every time a window is closed, the window count changes, and ' the macro must go through the cycle again RecyclePoint: CountOfWindows% = CS.WindowCount - 1 For i = 0 To CountOfWindows% If CS.SetTopWindow( i ) = TRUE Then TypeOfWindow% = CS.ItemType Select Case TypeOfWindow% Case 3 CS.CloseRecord( False ) GoTo RecyclePoint: Case 10, 11, 16 Bool = CS.CloseList GoTo RecyclePoint: End Select Else MsgBox "SetTopWindow( " & CStr( i ) & " ) seems to have failed!" End If Next i End Sub