This site uses cookies.
Some of these cookies are essential to the operation of the site,
while others help to improve your experience by providing insights into how the site is being used.
For more information, please see the ProZ.com privacy policy.
Samuel Murray Netherlands Local time: 13:25 Member (2006) English to Afrikaans + ...
Jul 3, 2019
Hello everyone
Does anyone know of a Word macro that can be used to send the currently selected text to the browser as a Google search? I'm looking specifically for a Word macro and not for e.g. an AU3 or AHK script.
Thanks Samuel
==
Subject:
Comment:
The contents of this post will automatically be included in the ticket generated. Please add any additional comments or explanation (optional)
wotswot France Local time: 13:25 Member (2011) French to English
Here's the code you need
Jul 3, 2019
Create a module in VBA (in a .dotm file or your normal.dot(m), if you have one) In the new module, copy everything below the dotted line exactly as is. (You may want to localize the google url) Select some text in Word Run the macro (only tested in Windows 7) -------------------------------------------------
Option Explicit Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As Strin... See more
Create a module in VBA (in a .dotm file or your normal.dot(m), if you have one) In the new module, copy everything below the dotted line exactly as is. (You may want to localize the google url) Select some text in Word Run the macro (only tested in Windows 7) -------------------------------------------------
Option Explicit Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Public Sub GoogleSearch() 'You can assign this macro to a function key if you want Dim T As String If Len(Trim(Selection.Text)) > 1 Then 'There must be some text selected in Word T = Selection.Text T = Replace(T, " ", "+") 'Words in the query's text must be separated by '+' OpenURL "http://www.google.com/search?as_epq=" & T 'the as_epq parameter means results must include the query, 'in the word order displayed. 'see the link below for a full list of google search URL parameters 'https://moz.com/blog/the-ultimate-guide-to-the-google-search-parameters End If End Sub
Private Function OpenURL(ByVal URLString As String) ShellExecute 0, "open", URLString, 0, 0, 1 End Function ▲ Collapse
Subject:
Comment:
The contents of this post will automatically be included in the ticket generated. Please add any additional comments or explanation (optional)
Translation Office 3000 is an advanced accounting tool for freelance translators and small agencies. TO3000 easily and seamlessly integrates with the business life of professional freelance translators.
Create customer quotes and invoices from within Trados Studio
Trados Business Manager Lite helps to simplify and speed up some of the daily tasks, such as invoicing and reporting, associated with running your freelance translation business.