J-F Bilodeau's Blog @ chronogears.com

Saturday, February 14, 2009

Get rid of all URLs in an OpenOffice document

I just stumbled on a really neat trick that I have to share with everyone. Recently, I had to take an HTML document and format it for printing. The act of transforming an HTML document to ODF was remarkably easy, thanks to styles and the find & replace command. However, I learned that getting rid of a URL (link) is not a trivial as I would have liked — especially if you want to get rid of all of them at once!

Purely by accident, I stumbled on the fact that replacing the link address by a space is the equivalent of deleting the URL. Yay!

Thus, to (cleanly) remove all hyperlink in a document without loosing the format, here's what you need to do:
  1. Select the entire document (CTRL+A or Edit->Select All)
  2. Open the format character dialog (Format->Character)
  3. Click on the Hyperlink tab
  4. Type a single space in the URL field
  5. Click OK!

Voila! No more URLs in the entire document. I've tested this with OpenOffice 2.4 and 3. Also, please note that this only works from the Format->Character menu command. The same does not work from the Edit->Hyperlink menu command.

Hope that's of use to someone out there!

J-F

Labels: