Searching with a Different Search Engine

by Allen Wyatt
(last updated August 11, 2018)

When working in a document, Lewis can select a word or phrase, right-click on it, and choose the "Search with Bing" option. He's not happy with Bing's search results and would much prefer to search with a different search engine, such as Google. Lewis wonders if there is a way to add other search engines to the right-click menu or, perhaps, change the "Search with Bing" option to use a different search engine.

The very fact that Lewis has a "Search with Bing" option on the right-click Context menu tells me that he is using either Word 2010 or Word 2013. This particular option doesn't exist in either Word 2007 or Word 2016.

In both Word 2010 and Word 2013 you can edit the Windows Registry to modify the "Search with Bing" option. Editing the Registry should be done carefully, as one misstep could result in an unusable system. (If you need a refresher on how to edit the Registry, including how to start the Registry Editor, see this tip on the WindowsTips site.) Follow these steps to make the modification:

  1. Exit Word.
  2. Start the Registry editor.
  3. Locate and select the following data key. (This data key, as shown below, is for Word 2013. If you are using Word 2010, change 15.0 to 14.0.)
  4.      HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Word\Data
    
  5. Choose Edit | New | String Value. The Registry Editor adds a new string value to the right side of the Registry and allows you to immediately enter its name.
  6. Name the new string value "SearchProviderName" (without the quotes).
  7. Right-click on the newly added string value and choose Modify from the resulting Context menu. The Registry Editor displays the Edit String dialog box.
  8. In the Value Data field enter "Google" (without the quotes.)
  9. Click OK. The information in the Registry Editor is updated.
  10. Again choose Edit | New | String Value. The Registry Editor adds another new string value to the right side of the Registry and you can, again, change its name.
  11. Name the new string value "SearchProviderURI" (without the quotes).
  12. Right-click on the newly added string value and choose Modify from the resulting Context menu. The Registry Editor displays the Edit String dialog box.
  13. 12. In the Value Data field enter "https://www.google.com/search?q=" (again, without the quotes).
  14. Click OK. The information in the Registry Editor is updated.
  15. Close the Registry editor.
  16. Restart Word.

Now, go ahead and select some text. When you right-click on it, the Context menu option has changed from "Search with Bing" to "Search with Google." If, at some point (and for some reason) you want to stop using Google and again start using Bing, just delete the two Registry entries you created in these steps.

The foregoing Registry modification won't work in Word 2007 or Word 2016. As already mentioned, neither of these versions include the "Search with Bing" option. (Word 2016 includes a "Smart Lookup" option, but no "Search with Bing" option.) The only way that we've been able to find to add a "Search with Google" option to the Context menu is to add some rather hefty macros to your document. The following, for instance, is a set of macros that will add the option on a Word 2007 system. These should be added to a regular VBA module:

Option Explicit
Dim oPopUp As CommandBarPopup
Dim oCtr As CommandBarControl
Private pWebAddress As String
Public 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

Sub BuildControls()
    Dim oBtn As CommandBarButton
    'Make changes to the Add-In template
    CustomizationContext = ThisDocument.AttachedTemplate
    'Prevent double customization
    Set oPopUp = CommandBars.FindControl(Tag:="custPopup")
    If Not oPopUp Is Nothing Then GoTo Add_Individual
    'Add PopUp menu control to the top of the "Text" short-cut menu
    Set oPopUp = CommandBars("Text").Controls.Add(msoControlPopup, , , 1)
    With oPopUp
        .Caption = "Search With Google"
        .Tag = "custPopup"
        .BeginGroup = True
    End With
    Set oBtn = oPopUp.Controls.Add(msoControlButton)
    With oBtn
        .Caption = "Google"
        .FaceId = 940
        .Style = msoButtonIconAndCaption
        .OnAction = "WebPage"
    End With
    Set oBtn = Nothing
Add_Individual:
    'Or add individual commands directly to menu
    Set oBtn = CommandBars.FindControl(Tag:="custCmdBtn")
    If Not oBtn Is Nothing Then Exit Sub
    'Add control using built-in ID 758 (Boo&kmarks...)
    Set oBtn = Application.CommandBars("Text").Controls.Add(msoControlButton, 758, , 2)
    oBtn.Tag = "custCmdBtn"
    If MsgBox("This action caused a change to your Add-In template." _
      & vbCr + vbCr & "Recommend you save those changes now.", _
      vbInformation + vbOKCancel, "Save Changes") = vbOK Then
          ThisDocument.Save
    End If
    Set oPopUp = Nothing
    Set oBtn = Nothing
lbl_Exit:
    Exit Sub
End Sub
Sub RemoveContextMenuItem ()
    'Make command bar changes in Add-In template
    CustomizationContext = ThisDocument.AttachedTemplate
    On Error GoTo Err_Handler
    Set oPopUp = CommandBars("Text").Controls("Search With Google")
    'Delete individual commands on the PopUp menu.
    For Each oCtr In oPopUp.Controls
        oCtr.Delete
    Next
    'Delete the PopUp itself.
    oPopUp.Delete
    'Delete individual custom commands on the Text menu.
Reenter:
    For Each oCtr In Application.CommandBars("Text").Controls
        If oCtr.Caption = "Boo&kmark..." Then
            oCtr.Delete
            Exit For
        End If
    Next oCtr
    If MsgBox("This action caused a change to your Add-In template." _
      & vbCr + vbCr & "Recommend you save those changes now.", _
      vbInformation + vbOKCancel, "Save Changes") = vbOK Then
        ThisDocument.Save
    End If
    Set oPopUp = Nothing
    Set oCtr = Nothing
    Exit Sub
Err_Handler:
    ' MsgBox Err.Number
    Resume Reenter
End Sub
Public Sub WebPage()
    pWebAddress = "https://www.google.com/search?q=" & Selection.Text
    Call NewShell(pWebAddress, 3)
End Sub
Public Sub NewShell(cmdLine As String, lngWindowHndl As Long)
    ShellExecute lngWindowHndl, "open", cmdLine, _
      Selection.Text, Selection.Text, 1
End Sub

In order to add the "Search with Google" option to the Context menu, simply run the BuildControls macro. If you later want to remove the option, you can run the RemoveContextMenuItem macro.

These macros are based on work done by Greg Maxey at his website, here:

https://gregmaxey.com/word_tip_pages/customize_shortcut_menu.html

As mentioned, the macros will work only on a Word 2007 system. For reasons that Greg discusses on his website, they will not work on Word 2016 systems without some rather major modifications, and they may not be stable even after the modifications because of changes that Microsoft continues to make.

Note:

If you would like to know how to use the macros described on this page (or on any other page on the WordTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (166) applies to Microsoft Word 2007, 2010, and 2013.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Using Less Paper on Printouts

If a worksheet contains nothing but a bunch of values in column A, you may be loathe to print the worksheet and "waste" a ...

Discover More

Formatting the Space after an Endnote Number

With lots of endnotes in a document, you may be puzzled by the space left between the endnote numbers and the text that ...

Discover More

Finding Workbooks Containing Macros

Workbooks can contain macros, or not. It is entirely up to you whether they do or not, but at some future time you might ...

Discover More

Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!

More WordTips (ribbon)

Setting Web Fonts

If you intend to generate a Web page from your document, you need to be concerned with the fonts that Word will use. ...

Discover More

Saving a Document as a Web Page

Want to save your document as a Web page? It's easy to do in Word; almost as easy as saving your document normally.

Discover More

Specifying Monitor Resolution

When using Word to create content that will end up on the Web, it is helpful to know the probably screen resolution of ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 5 - 2?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.