Skip to main content
OCLC Support

FindReplaceNextText

Find the syntax, use, parameters, return values, and an example for the FindReplaceNextText macro command in Connexion client.
Syntax BOOL = CS.FindReplaceNextText (sOldText, sNewText, bMatchCase)
Use to Find the next occurrence of specified text and select it.

Another instance of FindReplaceNextText replaces the selected text, moves to the next occurrence, and selects it.

This macro command combines FindText and Replace commands and is used primarily for the macro recorder.
Parameters
  • For sOldText, enter the text you want to find, enclosed in quotation marks (“).
  • For sNewText, enter the text you want to replace the “found” text, enclosed in quotation marks (“).
  • For bMatchCase, enter the boolean value to specify whether to match upper- and lowercase exactly or not match case:
    • True - Match upper- and lowercase exactly
    • False - Do not match case
Return values TRUE if the action is successful, or FALSE if not.
Example Sub Main()

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

     Dim sText As String
     Dim nResult As Integer

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

     CS.Search “WC”, “#1”

     CS.CursorRow = 9
     CS.CursorColumn = 1

     If CS.FindReplaceNextText(“Rand”, “McNally”, True) > False Then
          MsgBox “Rand not found”
     End If

     If CS.FindReplaceNextText(“Rand,” “McNally,” True) = False Then
          MsgBox “Rand not found”
     End If
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 WorldCat for record number 1.
  • Moves the cursor to the first column of the ninth row.
  • Searches the record for the text Rand, matching case exactly (case-sensitive). Selects it if found, or returns the message: Rand not found.
  • Replaces the selected occurrence of Rand with the text McNally, matching case exactly, and then finds and selects the next occurrence of Rand, if found, or returns the message: Rand not found.