Skip to main content
OCLC Support

SaveToLocalFile

Find the syntax, use, parameters, return values, and an example for the SaveToLocalFile macro command in Connexion client.
Syntax nSaveFileNumber = CS.SaveToLocalFile (bAuthUnlock, bDelete)
Use to Save a record, or records selected in a list, to the default local save file

Same as using the Action > Save Record to Local File menu command.
Parameters
  • For bAuthUnlock, enter True to unlock an Authority File record before saving to the local file, or enter False to save the authority record with its lock.

     Note: You cannot save locked bibliographic records to the local file.

  • For bDelete, enter True to delete a record you save to the local file from the online file, or enter False to keep the record in the online file when it is saved to the local file.

     Note: Entering values for these parameters is required.

Return values Save file number(s) the system assigns to the saved record(s).
Or
The value -1 when the corresponding command (Action > Save Record to Local File) is unavailable. The command is unavailable when a record is re-saved to the local file with no changes to the record.

If the macro returns -1, you can get the save file number by using: bool = QueryRecordStatus (“SAVE”, sNumber)
Example Sub Main()

     Dim CS As Object
     Dim nSaveFileNumber As Integer

     Set CS = GetObject(,“Connex.Client”)

     If CS.IsOnline = False Then
          CS.Logon ““, ““, ““
     End If

     If CS.Search “BS”, ““ > 0 Then
          nNumRecords = CS.SearchList(“Mitchell”, “Contributor/Creator”, False)
     End If

     nSaveFileNumber = CS.SaveToLocalFile (False, True)

     MsgBox “The record(s) were added as save file number(s)” + (nSaveFileNumber)
End Sub

What this example does
  • Logs on to Connexion if not already logged on, using the default authorization and password you selected in Tools > Options > Authorizations tab.
  • Searches the online bibliographic save file for all records.
  • Searches the results list for Mitchell in the Contributor/Creator column, returning terms with different case or that contain the term.
  • Selects the records that match (for the sake of this example, assume that four records are selected).
  • Saves the selected records to the local bibliographic save file and deletes them from the online save file.
  • Returns the message: The record(s) were added as local save file numbers 14 15 16 17.