Alternative dialog Find & Replace for Writer (AltSearch)

Primary tabs

Tomas Bilek

Average: 4.3 (41 votes)

writer, Free, editing, search
Post date:
Friday, 28 December, 2007 - 15:05
Week: Not tracked - Month: Not tracked - Year: Not tracked - Timeline
Download extension
System Independent version - All releases
Compatible with OpenOffice 4: Yes
User feedback:
Compatible with OpenOffice 4.x?
  • Fast selection preset regular and extended expressions
  • Searched or replaced text can contain one or more paragraphs
  • Search out block of paragraphs delimited by two text marks
  • Multiple search and replacement in one step
  • Searching: Bookmarks, Notes, Text fields, Cross-references and Reference marks to their content, name or mark and their inserting
  • Searching and inserting Footnote and Endnote (from version OOo 2.3 only). It is possible to select at once texts of all footnotes or endnotes and to assign them any style
  • Searching object of Tables, Pictures and Text frames according to their name; it is possible to substitute them by any text, etc.
  • Changing into found or replaced text: paragraph style, character style, list style and Hyperlink's URL and set properties
  • Inserting and replacement: clipboard contents, insert replacement counter and page number
  • Hexadecimal also decimal submission character for search and replaced
  • Searching out manual page and column break and their set up or deactivation
  • Searching similarly or the same manually formatted part of text, according to cursor point
  • Count found occurrences
  • Redirecting result of replacing expression to the other text file
  • Batch mode: saving and loading of search and replacement parameters; it is possible to save several searching and replacing subsequently to the single sequence and that whole quickly execute after. Execute the batch with more opened text documents together.
  • Self dialogue for quick assignment of key shortcut to batches
  • Preserve capitalization - If found text begins with a capital letter, also the text replacement will begin with a capital letter
  • Searching for paragraph, character and list style; possibility to choose a style from the menu
  • Built-in help (
  • Language: English, Czech, Russian, Spanish, German, French, Dutch, Italian

Alternative dialog Find & Replace for Writer (AltSearch)

Version Operating system Compatibility Release date
1.4.2 System Independent 2.0, 3.0, 4.1 24/03/2017 - 17:45 More information Download
1.4.1 System Independent 2.0, 3.0, 4.0 15/11/2015 - 14:01 More information Download
1.4 System Independent 3.4, 4.0 01/01/2014 - 12:55 More information Download
1.3.2 System Independent 3.4 17/06/2010 - 14:22 More information Download
1.3.1 System Independent 3.4 03/05/2010 - 15:21 More information Download
1.3 System Independent 3.4 25/11/2009 - 18:14 More information Download
1.2.2 System Independent 3.4 08/05/2009 - 17:37 More information Download
1.2.1 Windows, Linux, MacOS X 3.4 28/07/2008 - 15:28 More information Download
1.2 System Independent 3.4 12/07/2008 - 16:37 More information Download
1.1.2 Windows, Linux, MacOS X 3.4 24/04/2008 - 17:51 More information Download
1.1.1 Windows, Linux, MacOS X 3.4 07/03/2008 - 15:42 More information Download
1.1 Windows, Linux, MacOS X 3.4 13/02/2008 - 09:50 More information Download
1.0 Windows, Linux 3.4 28/12/2007 - 16:07 More information Download


I've installed AltSearch as an extension for LibreOffice and it ran fine until I received a "BASIC syntax error. Expected: )." which highlighted "^^2 remplacements ont été effectués. " within msg(29) = "Lot '^^1' est terminé. "+chr(10+chr(10)+"^^2 remplacements ont été effectués. " I just can't escape this error even after uninstalling and reinstalling both the extension itself and LibreOffice.

I am having a problem with trying to remove blank lines at the end of table cells.

If you turn on the display of Non-printing characters you see what appears to be a paragraph mark at the end of the cell text but this is not a true paragraph mark but an end of cell marker and cant be found by AltSearch's paragraph end searches ($ or \p)

This means that a normal empty paragraph search ^$ cant be used to remove a blank line at the end of cell when a normal paragraph mark precedes the end of cell.

Is there any way use AltSearch to detect the end of a table cell and replace trailing blank lines.


I want to remove the page breaks inserted by the Mail Merge Wizard between each page

I try searching for \m replacing by \r and although it reports it has changed the expected number of entries the page breaks remain

If I bring up the paragraph style dialog it shows
Breaks Insert [checked] Type Page
Unchecking Insert work but I need to automate this.

PS I did find that replacing with \A{BreakType=0} worked but only if the document is type HTML but not with .odt

How about an Alt-Find&Replace function which finds "everything between".
Suppose you had a large text file with many sections delimited like this:

It'd be great if you could:
(1) Search For NOTICE . . function for "everything between" . . END NOTICE
(2) and click "Find all"

All such sections will be selected. They could then be copied and pasted to a new file so that any other Find&Replace work could be done from there.

Thanks! I use Alt Find&Replace constantly! Great extension!

Try Extended - Series of paragraphs =>
Begin text[::BigBlock::]End text

\R - redirects the replace expression to another text file:
Replace: \R\b&\e\p\p

This extension works, allowing a lot of search/replace options that are otherwise impossible. Unfortunately, with large documents it's very, frustratingly, almost unusably, freaking slow. If it wasn't the only way in Open Office to search across paragraphs, I'd call it a piece of crap. I'm sorry to say that. I'm not a programmer, so I imagine there's a very good reason why it's so slow. I know this may be like complaining about the speed of light, but is there any way it can be sped up? Or if the regular Open Office find-and-replace function could recognize end-of-paragraph markers so that broken paragraphs fragments can be merged easily and quickly?

This extension makes my work so much easier. I wish they would incorporate it into the program. Thank you for sharing your work with the community.

It used to be ok, but now any search involving a character escape (like "\(\d+\)" to search footnotes) doesn't work anymore. I tried to reinstall the extension, then i reinstalled OpenOffice...nothing worked. Any idea?
OpenOffice regular search works ok, even with regex and characters escape, but I really miss many functionalities from your extension...

What's the shortcut key for that Find and Replace dialog box?

Eric Nguyen

How does one replace several paragraph marks or the tab marks with text?
I know what "regular expressions" means, but unable to remember how to use them between needs.
Can you please add these type of formatting changes?

AltSearch worked fine for me till I installed OOo 3.4.1. The green binocular has disappeared, and when I try to re-install the extension, I get a message that says "an error occurred while opening the file".
Am I alone?....


Apologies in advance if I'm being stupid, but I can't work out how to convert image URLs into the actual images.

I start with text like this: "[img][/img]

I've tried converting it to: "" but I only see the code.

Is there a way of making it so that the document displays the actual image itself, rather than just the address?



It is probably result of changes processing regular expressions in OOo 3.4, without the backward compatibility...

With this extension, searching for
do not work on AOO 3.4. This makes "Text between ( )" fail too. Changing those expressions by \u0028, \u0029... works. (NOTE: \( and all the others work without problem on native RegEx system).

The suggested way to search for non breaking dash, \x2011, do not work, but \u2011 does.

Other than that, the [::BigBlock::] thing is a killer feature!! :)

I use the search for text between [] all the time. I put citations and notes in between brackets when I'm working on a paper. Then I convert the citations to hidden text when I'm done with the report. AltSearch used to make quick work of this. Then it broke in Apache's OO. But, with rgb's comments above, I got it working again. I just replaced the standard search string for text within [] with the following:
I then put in my normal replace string to change the formatting to hidden. Then I hit the batch button and gave it a name. Now when I need to do the search, I just hit the 'batch >>' button, choose it from the list, and hit the 'transfer' button. Now I can single step through my conversions. Works like a charm!

It seems like a simple solution to the new format for unicode in OO 3.4.1 would be change the AltSearch code to check for the Apache version of OO and use all \u prefixes in place of all the \x prefixes. Maybe that's not as easy as it sounds.

In any case, I'm back to loving AltSearch!

I want to replace underlined characters with bold ones. I can search for underlines but I can't find out how to replace them with the same text but with another attribute (or just remove the underlining). Thanks for your help.

I don't know with what version this error began. I am currently using LibreOffice 3.5 and Java 1.6 but it also occurred on earlier versions. To reproduce the error just create a new document with one word. Put that word in the search for box and & in the replace box. Enable regular expressions and do a search and replace and it will fail in both Linux and Windows. In the AltSearch macro, under D_choice, if line 1589 of the code (seznam.addItem(neco,0)) in the Common tab is commented out it seems to work but I have no idea as to what it may break by doing that.

Thank you for the response. It looks like \0 will do the job.

I have a text file with carriage returns. In all cases, the carriage returns are proceeded by either a letter or a space. I need to delete all cases of space followed by carriage return. To do this, I'm using s\$ in the find dialog box and leaving the replace box blank. While the find tool accurately locates all cases of s\$, when I click replace, only the space is deleted. Interestingly, if I search using just $, and click replace, the carriage return is deleted. Any suggestions?

Great extension ! Works well on ubuntu with open office 3.2.0
Thank you !

Hi, I hope this is still being maintained as it's a great extension.
I've got a dual boot set-up and it works perfectly under Wndows 7 with libreoffic 3.4.1

Running Ubuntu 11.04 & libreoffice 3.4.1 it mostly works - except for regular / extended / properites buttons.

Is there a fix for this?

I would also like to report having problems with this extension - it doesn't react at all. Can this be corrected? I am using the latest OpenOffice. Thank you in advance.

Short Description: Alt Search and Replace stopped working after an upgrade. Instead of opening a Search and Replace dialog, it opens a new OOo window for My Macros & Dialogs and displays a 'BASIC runtime error' error message

Long Description: I upgraded Alt Search and Replace about a month ago. Previous version worked to my great satisfaction and delight. Sadly, this most wonderful extension stopped working after updating. When I click on the green binoculars, the application pauses for a moment, clangs an error alarm and opens a
> window: [MyMacros & Dialogs]:AltSearch
> tab: fromTools
> Error Dialog: "BASIC runtime error. An exception occourred. Type: Message: {OK button}

Vista HP sp2
OOo 3.1.1

Attempted work-arounds:
1. Reinstalled the extension. No joy.
2. Uninstalled the extension, reinstalled the extension, shut down OOo, restarted OOo. No joy
3. Uninstalled the extension, reinstalled the extension, shut down OOo, shut down PC, restarted PC, restarted OOo. No joy.

Comment: From scrolling through this thread, this "No.SuchElementException" problem seems to occour with some frequency. For those of us who are not BASIC programmers, is there a step by step work around for this problem? I really miss having this extension.

Thanks for any help anyone can suggest

This looks like it would be a good extension, but I can't get it to load. I went through the installation process, and got no complaints or errors. However, the Binocular icon doesn't show (yes, I did shut down OOo and then restarted) in the Tool bar.

I am running OOo 3.1.1 on a Ubuntu 9.10 system if that makes a difference. Any suggestions?

I've found AltSearch a huge help working with old converted files; the LibreOffice people are nuts to build in the extensions they did and not this one!

Unfortunately, installing your latest version with current official-RPM versions of OOo (and, after completely removing OOo, LibreO) today threw an error similar to someone else's; it was auto-disabled & error reappears if I enable it. Rebooting didn't help.
The error (with the .office and variable after Backend/ changing based on the install):
( { { Message = "bad root element in file:///home/xyzzy/.libreoffice/3/user/uno_packages/cache/registry/", Context = ( @0 } }

This is a great and useful tool! I use the Italian version on Mac.
However, I detected a problem in the "entire word" option search, that is not working properly and should be arranged because so crucial!

it is great tool!
Author! thank's a lot for this excellent addon!
may be it will be useful for anybody(and not only me) to get "element of table of contents"(or how it named in english) in "replace" list?
last target is to get table of contents based on text with specific symbol style.

This tool is amazingly usefull. How hard would it be to make this available for Calc as well as writer? I work with huge spread sheets on a regular basis and often wish I could use regular expressions in find & replace to alter large groups of cells based on patterns. Right now I usually just save the file as a tsv and open it in notepad++ to use regular expressions, but that doesn't always work out as predictably as I would like, and it would be oh so convenient to be able to do the searches right in Calc.

This is a great tool!

I had been having a hard time replacing fonts or changing font size of pieces of text intersperse within a huge document. It was a extremely tedious.

This tool saved me lots of time.

The only problem I find is that it is not able to search for Asian fonts.

For example, I can search for CharFontName=Times Roman and replace it with an Chinese Font CharFontNameAsian=KaiTi.

But I can't search for CharFontNameAsian=KaiTi.

It seems strange that I can replace the CharFontNameAsian attribute of the text but not able to search based on the CharFontNameAsian attribute. The search only works on the CharFontName attribute.

This would be a refinement I would look forward too!

God bless the author!

I read back on previous comments and tried rebooting the whole system, which worked. Sorry about that. Relieved as well :).

This great extension has always been my favorite. I upgraded to the latest version of OOo, 3.2.1, and now nothing happens. When I click on the icon it simply does nothing. I am running Vista.

Thank you so much, this extension is great!
Saved me many times ... the search and replace of Writer has several limitations.
Coming from MSWORD helped me a lot to get used to using Writer.
If you're looking for inspiration ...
This extension will recommend it to everyone! A must try!
Thank you again.

I cannot install version 1.3.1 into OOo_Dev300m80
I get the msg
({{Message = "bad root element in file:
///Users/~/Library/Application Support/OOo-dev/3/user/uno_packages/cache/
uno_packages/7irZ2Z_/AltSearch.oxt/addon.mod", Context = (}}
Al Maloney
Using OOo_Dev_DEV300 on Mac OS X 10.6.3
"Velox Versutus Vigilans"

I would really like to use this extension again.
Is it incompatible with my version of OOo?
Is there something I can do to resolve the problem?
(I have the same problem with TestFonts)
Al Maloney
Using OOo_Dev_DEV300 on Mac OS X 10.6.4
"Velox Versutus Vigilans"

Thank you Tomas!
That works now.
Can you do the same for TestFonts?
Al Maloney
Using OOo_Dev_DEV300 on Mac OS X 10.6.4
"Velox Versutus Vigilans"

Hi - I love this extension, but since upgrading my system it won't install for me. I recently installed Ubuntu Lucid 10.04LTS, which comes with OOo 3.2 (OOO320m13, Build:9483, to be precise). The extension shows as installed under the Extension Manager, but no toolbar button or menu item is created. Is there anywhere I can file a bug report or get some support?

1. Make sure you have installed JRE - ooo Java Runtime Enviroment.
2. Sometimes it is necessary to restart OOo, including quickstarter (if is used). or whole operating system.

On win XP and OOo 3.2 it is working OK.

Try direct run: Tools - Macros - Organize macros - OOo basic: My macros - Altsearch and direct run _Altsearch.

(try JRE instal by terminal: sudo apt-get install default-jre)

on the basis of my last comment, it (finally) occurred to me that I might have a corrupt download, so I downloaded again, and sure enough the md5sums were different. Installation of the new file has proceeded as expected. (I'm getting a OOBasic runtime crash if I try to resize the window, but I don't think that issues is specific to this extension :)).

Sorry to have wasted your time, and thank again.

Hi tombil, thanks for your continued interest in this.

Well, it seems like it's an installation problem of some kind - Altsearch doesn't exist under "My Macros". Can I extract the macro manually from the package and add it myself? Is there a tool I can use to open the package? (File Roller reports "End-of-central-directory signature not found.", and `jar -x` just hangs.... know very little about java programming and nothing about OOo extensions, and don't have time to bone up right now!)

Thanks again!

... and same error message:

"BASIC runtime error.
An exception occurred.
Message: ."

but my highlighted line in the code reads:


(Just in case, I've tried the solution the author proposed in reply to the other comment, a previous version of the extension, but no luck)

Any idea what might be the problem, anybody? This extension is really useful, I'd hate to do without it!

Running OOo 3.1.1


It was installed & working just fine on my system (SimplyMEPIS Linux 8.5, OOo 3.1.1) until I uninstalled the spreadsheet/database programs... It promptly started giving me the same error screen you described, and kept doing it until I decided to try reinstalling the "missing" programs -- at that point it started working again.

There is an issue with searching within large paragraphs:

I wonder if you can make this excellent extension to work where the native one fails.

I have the same problem as Mike. Clicking on the green binoculars or accessing the menu does nothing, and does not produce an error message.

I have OOo 3.0.1 on Ubuntu 9.04, 64 bit version.

Sometimes it is necessary to restart OOo, including quickstarter (if is used).
In the worst case the entire operating system too.

I just installed 3.1.1. I tried to install Mr. Bilek's AltSearch extension (which I've used extensively under OOo 2.4). The green binocular icon appears as expected, but clicking on it produces no response (including no error message). Any suggestions?



This extension has been great, and I appreciate all of the documentation that goes with it - except I was unable to find documentation that explained how to simply replace some text in a regular font with a bolded font. Apparently this involves understanding internal OpenOffice character style attributes. (Does someone know of an easier way that I missed?) Hopefully this will help someone out in a similar situation...

I had text of the form "Region 1" or "Region 11" where I wanted to make every occurrence bold. Here's what I did:

Find (using Regular Expressions): ^Region\s([0-9][0-9]?)
Replace: \C{Quotation}\A{CharWeight=150%}\A{CharPosture=0}

The first part of the replace (\C{Quotation}) was added by choosing "Character Style" from the Replace drop-down list. The second parts were more difficult to determine. The general format of (\A{SOMETHING}) was listed in the replace drop-down as well, but neither CharWeight nor CharPosture were actual options in the PickProperties drop-down. I found that these were the actual options I needed to use by trial and error and eventually found what the available attributes were for each style by going to According to the wiki, while things like BOLD and NONE (for CharWeight and CharPosture respectively) are supposed to be valid options for these styles, neither would work and I had to use a numeric value.

The CharPosture part was necessary because whenever I used CharWeight to make the text bold, it automatically italicized the text as well. Including CharPosture=0 was necessary to make it un-italicized again. I'm not sure if this is a bug in OpenOffice or the extension, or just by-design.

Overall, I'm pleased at the power of this extension and it still saved me a lot of time and manual formatting... but there is still room for improvement in the documentation and in making it easier to use. All in all, thanks for making it!

(Using Alternative Find & Replace for Writer version 1.2.1 on 3.0.0)

To change the character or paragraph formatting, I use character / paragraph styles. In your case, I'd suggest to create a character style "bold" (or similar), then use the following syntax:

Find: region \d{1,}
Replace: &\C{bold}
Regular Expression: on

If you want to add to every occurance of "region" a ascending number, you may use the following syntax:

Find: region
Replace: & \i \C{bold}
Regular Expression: on
Replace all

"Replace all" is essential in this case, otherwise you will always get "region 0".