Setting up the macro
You need to set up a macro in your word processor in order to perform an Internet Concordance Search.
Before you begin, decide which search engine or reference website you will be using for your search query.
You will create a macro that copies the term or phrase you highlighted and then uses these words for an exact-phrase query in the search engine. The easiest way to do this is to open the Visual Basic Editor in your word processor.
- Open Visual Basic Editor and copy the following code for the macro.
This is the code for a specific website. You need to change the code to go to other websites.
Sub GoToGoogleSearchWordOrPhrase() 'tooltip
Dim searchTerm As String
searchTerm = Selection.Text
ActiveDocument.FollowHyperlink _
Address:="http://www.google.com/search", _
ExtraInfo:="q=""" & searchTerm & """"
End Sub
Note: If you don't know how to create macros with Visual Basic Editor, read the online documentation or look it up on the internet.
- Assign a button to the macro.
- Create a second macro to refer to a different website by replacing the value for the Address and ExtraInfo. You now have 2 macros that take you to different websites.
- Create a toolbar and add the macro buttons to the toolbar.
- Save the document as a template and put this template document in the start-up folder of your word processor so the macro toolbar is displayed each time you open your word processor.
You should now be able to obtain search results by simply highlighting text and clicking the macro button.