' MacroName: UpdateHoldingsFromFile ' MacroDescription: Update holdings from a pre-created file of ' OCLC numbers ' Macro written by: Joel Hahn, Niles Public Library District Declare Sub Update(Agency$, OCLCNum$) sub main Dim CS as Session Set CS = CurrentSession 'Put your library's 4-letter holdings code here Agency$="####" 'Put the full path of the file where the OCLC numbers are here filename$="C:\UPDATE.TXT" filenum%=FreeFile Open filename$ For Input As filenum% x=1 Do Until x=Lof(1) Line Input #filenum%, OCLCNum$ Call Update(Agency$, OCLCNum$) x=x+1 y=Seek(1) If y>Lof(1) then x=Lof(1) Else Seek 1,y End If Loop Close filenum% Kill filename$ end sub sub Update(Agency$, OCLCNum$) dim CS as Session set CS = CurrentSession RecNum$="#"+OCLCNum$ CS.PutText RecNum$, 1, 1 RunMacro "PRSMUTIL!SendCommand" CS.PutText "tag 049", 1, 1 RunMacro "PRSMUTIL!SendCommand" CS.PutText Agency$, 6, 16 CS.ToggleEdit RunMacro "PRSMUTIL!SendEdits" CS.MoveCursor 1, 1 CS.PutText "u" RunMacro "PRSMUTIL!SendCommand" ' CS.Receive 5, "updated" end sub