Ask Your Question

Link to browser in Writer

asked 2018-09-28 21:59:06 +0200 gravatar image

It would be very helpful to have a way to highlight a word or phrase in Writer and select it to open a search in a browser to find that word or phrase.

I do considerable research when I'm writing and have to copy and paste words and phrases into my browser search. Google Docs does this, but, of course, that is all done from within the browser.

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2018-09-28 23:31:06 +0200

Ratslinger gravatar image

updated 2018-09-29 23:01:40 +0200


Have recently answered this here -> Internet lookup.

The solution is to use a macro. The text is highlighted then a right click and select Google_search. Have just retested this on Mint 18.3 using LO v and have no problems.

Sample (macros included) --- InternetSearch.odt

Please refrain from comments such as Google Docs does this.... It doesn't matter who else does what. If LO doesn't do something then a request should be made on Bugzilla.


Sorry but I should have mentioned that the macro in the sample is set to use Firefox. If you use a different browser, the macro must be changed.

Edit 2018-09-29:

Not certain why you are having the problem. Have taken this same sample and it obtains whatever is highlighted each time:

image description

Edit #2 2018-09-29:

On the original site where the code is posted, there is a second routine (similar to the first). This one uses the default browser. Also, if a word/phrase is not selected it will search on the word the cursor is on or nearest to.

Sample #2 ---- InternetSearch2.odt

Edit #3 2018-09-29:

From menu -> Tools->Customize and on Context Menus tab:

image description

Notice on left panes the Category of Macros was selected from dropdown list (near bottom). This list the macros available in your document & for the modules. If you want this to be available across ALL Writer documents, you should place the macro in My Macros before assigning this. In the right panes notice my scope was for the document. You could choose Writer. The Target is Text. Once you select the macro wanted and the target, use the arrow (middle section) to create an entry on the right. You can use the Modify button to give it a new name . You can also use the up/down arrows on the far right to move the entry in the list of items.


edit flag offensive delete link more


Thank you. I've tried to use the macro in the example document you supplied. I first changed the browser to "google-chrome". With this I either got an error message from Chrome or nothing. I changed the browser back to "firefox" and still got nothing. (I can execute firefox in a terminal window, so I know it's there.) I've also tried Tools>Macros>Run Macro, but no luck. gravatar ( 2018-09-29 19:04:05 +0200 )edit

What OS & LO version are you using?

Ratslinger gravatar imageRatslinger ( 2018-09-29 19:09:09 +0200 )edit

I changed the Macro Security Level to Medium. I got a lookup from firefox (locomotive) once. But not a second time. gravatar ( 2018-09-29 19:11:37 +0200 )edit

Ubuntu 16.04. Latest update. LO gravatar ( 2018-09-29 19:12:26 +0200 )edit

Through trial and error, I got this to work in a terminal:

firefox gravatar ( 2018-09-29 19:50:40 +0200 )edit

Tried that in macro:

 sGooglePhrase = ""+sSendPhrase+"%22"

and it works the same for me as the original statement. You may want to try.

Ratslinger gravatar imageRatslinger ( 2018-09-29 20:13:49 +0200 )edit

I think I must have disabled macros somehow when I first opened your example doc. I reopened your example, and when it asked if I waned to enable or disable macros, I picked "enable."

So now it works. My mistake. Thank you very much. gravatar ( 2018-09-29 20:54:26 +0200 )edit

I'm trying to add Google_search to the context menu. I see in your example that you have "Google_search" in the text context menu. I have tried to do that, but I can only get it to add a separator or submenu. Also, I don't see how to assign a macro to the menu item. I've looked at the documentation, but I think some of it is old or I haven't found the right sections. Is there any advice you can give me about adding the menu item and the macro? gravatar ( 2018-09-29 22:39:56 +0200 )edit

Will edit answer with info on context menu. Hope you looked at 2nd sample as I believe it is actually better than first.

Also, as you have been helped, please help others to know the question has been answered by clicking on the ✔ in upper left area of answer which satisfied the question.

Ratslinger gravatar imageRatslinger ( 2018-09-29 22:48:58 +0200 )edit

Yes, thank you. I will certainly click the checkmark. gravatar ( 2018-09-29 22:56:16 +0200 )edit

You did quite a bit of work on it. I appreciate it. Others will certainly benefit. gravatar ( 2018-09-29 23:00:25 +0200 )edit

Unfortunately, I cannot find your Google_search entry in the Text context menu. I saw it once, but not now. Sigh. Never mind. Found it. Just need to know how to assign a macro to the menu item - and how to get a single menu item in the list, not a submenu. gravatar ( 2018-09-29 23:02:28 +0200 )edit

Make sure Scope is correctly selected. Mine is set in the document and not writer. See answer for more info.

Ratslinger gravatar imageRatslinger ( 2018-09-29 23:04:47 +0200 )edit

Okay. Found it. Thank you. I didn't see the two items on the bottom of the list. I very much appreciate your help. It works now. Whew! gravatar ( 2018-09-29 23:21:23 +0200 )edit

answered 2018-09-28 23:30:43 +0200

m.a.riosv gravatar image

Select the text to use as hyperlink and then [Crrl+] or Menu/Insert/Hyperlink.

edit flag offensive delete link more



You were kind enough to provide me a macro to look up phrases from Writer documents. It works well with firefox, but will not reliably work with google-chrome. I learned a bit about writing macros and added a line code to the end:


The firefox window appears, but the google-chrome window does not. Also, I can type google-chrome into a terminal window and it works. gravatar ( 2018-10-13 22:34:35 +0200 )edit

Is there a problem in ConvertToURL with the hyphen in google-chrome? gravatar ( 2018-10-13 22:35:00 +0200 )edit

No, that's not it. I created a hyphenated bash script ("part1-part2") that just ran google-chrome $1 and it worked fine when executed from Shell. gravatar ( 2018-10-13 23:47:38 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2018-09-28 21:59:06 +0200

Seen: 157 times

Last updated: Sep 29 '18