'MacroName:505SubfieldG 'MacroDescription: removes $g from before articles 'written by John Lavalie, July 13, 2006 option explicit option compare binary global CS As Object global subfieldG, subfieldT as string '-------------------- function replace(strString as string, strOld as string, strNew as string) as string dim pos as integer pos = instr(strString, strOld) do while pos > 0 strString = left(strString, pos - 1) & strNew & mid(strString, pos + len(strOld)) pos = instr(strString, strOld) loop replace = strString end function '------------------- Sub Main Set CS = CreateObject("Connex.Client") dim found505, x%, tag505$ subfieldG = chr(223) & "g" subfieldT = chr(223) & "t" x% = 0 do x% = x% + 1 found505 = CS.GetField ("505", x%, tag505$) tag505$ = replace(tag505$, subfieldG & " A " & subfieldt, subfieldt & " A") tag505$ = replace(tag505$, subfieldG & " An " & subfieldt, subfieldt & " An") tag505$ = replace(tag505$, subfieldG & " The " & subfieldt, subfieldt & " The") tag505$ = replace(tag505$, subfieldG & " El " & subfieldt, subfieldt & " El") tag505$ = replace(tag505$, subfieldG & " La " & subfieldt, subfieldt & " La") tag505$ = replace(tag505$, subfieldG & " Los " & subfieldt, subfieldt & " Los") tag505$ = replace(tag505$, subfieldG & " Las " & subfieldt, subfieldt & " Las") CS.SetField x%, tag505$ loop until not found505 End Sub