'MacroName:AlifAyn2Apostrope 'MacroDescription:Find and replace all alifs and ayns with apostrophes 'Macro written by: Joel Hahn, Niles Public Library District 'Macro last updated: 15 November 2012 Option Explicit Sub Main Dim nCurCol, nCurRow As Integer Dim nFixedAlif, nFixedAyn As Integer Dim nRecType Dim retval Dim CS As Object On Error Resume Next Set CS = GetObject(,"Connex.Client") On Error GoTo 0 If CS Is Nothing Then Set CS = CreateObject("Connex.Client") End If nCurCol = CS.CursorColumn nCurRow = CS.CursorRow CS.CursorColumn = 1 CS.CursorRow = 1 nFixedAlif = CS.ReplaceTextAll(Chr(174), "'", TRUE) nFixedAyn = CS.ReplaceTextAll(Chr(176), "'", TRUE) If nFixedAlif + nFixedAyn = 0 Then MsgBox "No instances of Alif or Ayn were found in this record." Else MsgBox "All instances of Alif or Ayn were converted." End If CS.CursorRow = nCurRow CS.CursorColumn = nCurCol End Sub