'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 April 2009. ' 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 CountOfAuthorityWindows% : CountOfAuthorityWindows% = 0 Dim CountOfWindows% Dim TypeOfWindow% 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, 4, 18 CountOfAuthorityWindows% = CountOfAuthorityWindows% + 1 CS.CloseRecord( False ) GoTo RecyclePoint: Case 10, 11, 13, 16, 22 CountOfAuthorityWindows% = CountOfAuthorityWindows% + 1 CS.CloseList GoTo RecyclePoint: End Select End If Next i If CountOfAuthorityWindows% = 0 Then MsgBox "There are no authority records or lists to close!", 64, "Nothing to close" End If End Sub