'MacroName:Level3 'MacroDescription:fix level 3 records 'written by John Lavalie, Sept. 20, 2007 option explicit Sub Main Dim CS As Object Set CS = CreateObject("Connex.Client") dim tag$, x%, found, pos%, previousPos%, AuthorMainEntry CS.SetFixedField "Desc", "a" 'move 720s x% = 1: found = FALSE found = CS.GetField("720", 1, tag$) AuthorMainEntry = found do while found CS.DeleteField "720", 1 if right(tag$, 1) <> "." and instr(tag$, chr(223)) = 0 then tag$ = tag$ & "." if x% = 1 then tag$ = "1001 " & mid(tag$, 6) CS.SetField 1, tag$ else tag$ = "7001 " & mid(tag$, 6) CS.SetFieldLine x% + 100, tag$ end if x% = x% + 1 found = CS.GetField("720", 1, tag$) loop 'fix indicator, add period at end of title CS.GetField "245", 1, tag$ tag$ = trim(tag$) if AuthorMainEntry then tag$ = "2451" & mid(tag$, 5) if right(tag$, 1) <> "." then tag$ = tag$ & "." 'insert colon before subB pos% = instr(tag$, chr(223) & "b") if pos% > 0 then if mid$(tag$, pos% - 2, 1) <> ":" then tag$ = left(tag$, pos% - 2) & " : " & mid(tag$, pos%) end if end if 'make title lowercase pos% = instr(tag$, " ") do until pos% = 0 tag$ = left(tag$, pos%) & lcase(mid(tag$, pos% + 1, 1)) & mid(tag$, pos% + 2) previousPos% = pos% + 1 pos% = instr(previousPos%, tag$, " ") loop CS.DeleteField "245", 1 CS.SetField 1, tag$ 'fix 260 CS.GetField "260", 1, tag$ pos% = instr(tag$, chr(223) & "c") if pos% > 0 then if mid$(tag$, pos% - 2, 1) <> "," then tag$ = left(tag$, pos% - 2) & ", " & mid(tag$, pos%) CS.DeleteField "260", 1 CS.SetField 1, tag$ end if end if 'add 300 CS.GetField "300", 1, tag$ if len(tag$) < 1 then CS.SetField 1, "300 p. ; " & chr(223) & "c cm." CS.Reformat End Sub