Archive for December, 2006

FixQuote macro for MS Word

December 6, 2006

Bar llan Responsa CD has a funny way to show bibliographical quotes – it puts it surrounded by plus sign before the quote. This bothered my wife so I wrote her a Word macro to fix it. All she has to do to use it is to move the selection to the end of the quote, and run the macro. Here it is in case it somehow gets deleted, as it did today:

Sub FixQuote()

Dim quoteRange As Range
Dim quote As String
Set quoteRange = Selection.Range
quoteRange.Find.Execute FindText:="+*+ ", Forward:=False, MatchWildcards:=True
quote = quoteRange.Text
quoteRange.Text = ""
quote = " (" + Mid$(quote, 2, Len(quote) - 3) + ")"
Selection.InsertAfter quote
Selection.Collapse wdCollapseEnd

End Sub