Word macro for multiple term searches in Google Chrome

Laura Ramírez Polo is a lecturer for terminology management, among other things, (see her Linkedin profile here) and she gave an excellent presentation on terminology tips and tricks during the recent ATA Conference. One of the very useful tools that she shared was this macro code for Word. Those of you who, like me, love using macros will find it very useful. The original macro used Internet Explorer, but I have experienced problems with IE before, so I have adjusted it to open your favorite terminology databases in Google Chrome. Feel free to contact me if you have any questions. If you don´t know how to install macros, Google will probably help you with that better than I could.

If you want to add more dictionaries, replace the “3” in “arrSites(3)” by the number of dictionaries you want to add and add the dictionary to the list (text marked in blue). Make sure you don´t delete any codes while changing this. In this macro, I have added UNTerm, IATE, Termium, and Linguee. Needless to say, if you want to turn this into a monolingual search, just change the URLs with your favorite dictionaries, and don´t forget to change the number (3) if you want to add more.

Sub Dictionaries()

‘ Look at different dictionaries

Dim theTerm As String ‘ Term to look up in dictionary

Dim strURL As String ‘ The URL to open in Explore

Dim arrSites(3) ‘Web pages

Dim appPath As String ‘Browser Application path

 

‘Path for Chrome

appPath = “””C:\Program Files (x86)\Google\Chrome\Application\chrome.exe”””

 

‘ If nothing is selected

If Selection.Type = wdSelectionIP Then

‘ Select the term where the cursor is located

theTerm = Selection.Words(1).Text

Else

‘ Use the current selection

theTerm = Selection.Text

End If

 

theTerm = Replace(theTerm, vbCr, “”)  ‘ Remove any soft returns in the phrase that you have highlighted

theTerm = Replace(theTerm, vbLf, “”)  ‘ Remove paragraph breaks in the phrase that you have highlighted

theTerm = Trim(theTerm) ‘ Remove any spaces

 

arrSites(0) = “https://cms.unov.org/UNTERM//search?urlQuery=” + theTerm

    arrSites(1) = “http://iate.europa.eu/SearchByQueryLoad.do?method=load” + theTerm

    arrSites(2) = “http://www.btb.termiumplus.gc.ca/tpv2alpha/alpha-fra.html?lang=fra&i=1&srchtxt=” + theTerm

    arrSites(3) = “https://www.linguee.com/english-spanish/search?source=auto&query=” + theTerm + “&title=21st”

 

For i = 0 To 3 Step 1

strURL = arrSites(i)

‘Open browser using the path specify for each url

Shell (appPath & ” -url ” & strURL)

Next i

 

End Sub

 

Leave a Reply

Your email address will not be published.