'MacroName:SirsiCopy 'MacroDescription:Copy a field to the Clipboard in a format suitable for pasting into SIRSI Workflows 'Macro Created by: Joel Hahn, Niles Public Library District 'Last modified: 29 March 2005 sub main 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 bool = CS.GetSelectedText(text$) If text$ = "" Then Exit Sub Do While InStr(text$, Chr(223)) place = InStr(text$, Chr(223)) lt$="" : rt$="" If place > 1 Then lt$ = Left(text$, place-2) rt$ = Mid(text$, place+1) text$ = lt$ + "|" + Left(rt$, 1) + Mid(rt$, 3) Loop i = 2 PrevChar$ = Mid(text$, i-1, 1) Do CurChar$ = Mid(text$, i, 1) Select Case Asc(CurChar$) Case 224 To 237, 239 To 251,254 'Move to be before previous non-diacritic character NewText$ = NewText$ & CurChar$ LastCharDiacritic = TRUE Case Else 'Do nothing special NewText$ = NewText$ & PrevChar$ PrevChar$ = CurChar$ LastCharDiacritic = FALSE End Select i = i + 1 Loop While i <= Len(text$) If LastCharDiacritic = FALSE Then NewText$ = NewText$ & CurChar$ Else NewText$ = NewText$ & PrevChar$ End If text$ = NewText$ Clipboard.Clear Clipboard.SetText text$ end sub