Well, I have a method, but you may not like it! Hopefully, someone else will have written a macro
that can do this for you, otherwise....
This is a general approach that I use to overcome various shortcomings in Ooo. Your level of expertise with your operating system tools & utitlities will determine how "automated" the process will be. If you are unable to "script-up" some or all of these operations, then this method will almost certainly NOT be quicker than editing the files manually!
My method relies on the fact that the OOo file format is actually a .zip file full of .xml (and other) files which contain the documents text, style information, pictures and other stuff.
In
overview, my method is:
1. Unzip the .odt file(s)
2. Edit the .xml (text) files directly using a decent text editor or other tools that can do global change and replace across multiple files e.g. the excellent and free CONtext editor under Windows, or command line text editing tools like sed, awk, or perl scripts (*nix/cross-platform)
3. Zip 'em back up again.
Now in more detail - I'm assuming Windows (although the technique translates to *nix etc easily)
Also, I'd
definitely experiment with a single .ODT file first to get the hang of it.
1.
Make a backup-up of your files - Of course, you always keep a proper backup
anyway, don't you?
2. Rename your (e.g.) "Document.odt" file to be (e.g.) "Document.zip"
(This is not
scrictly necessary, particularly if you use a command line unzipper
like info-zip's unzip.exe, however many windows GUI unzippers won't easily unzip
the .odt files unless you rename them).
3. Unzip (e.g) Document.zip into a directory/folder called (e.g) "Document"
The built-in windows shell zip folder support works well for this because it creates the (e.g.) "Document" "root" folder for you. You want to end up with a folder/directory structure something like this:
Document\
<- The directory name corresponds to your "Document" name,
Document\Configurations2
Document\content.xml <- This file contains your document's text
Document\layout-cache
Document\META-INF
Document\meta.xml
Document\mimetype
Document\Pictures
<- This directory/folder contains any images in your doc (e.g. 3 below)
Document\Pictures\1000000000000060000000509E4D9BDA.jpg
Document\Pictures\10000000000000640000007FACEF61E3.jpg
Document\Pictures\1000000000000082000000825D82B018.gif
Document\settings.xml
Document\styles.xml
<- This file contains your style information
Document\Thumbnails
Document\Thumbnails\thumbnail.png
<- This is the document's thumbnail image
Document\Configurations2\accelerator
Document\Configurations2\floater
Document\Configurations2\images
Document\Configurations2\menubar
Document\Configurations2\popupmenu
Document\Configurations2\progressbar
Document\Configurations2\statusbar
Document\Configurations2\toolbar
Document\Configurations2\accelerator\current.xml
Document\Configurations2\images\Bitmaps
Document\META-INF\manifest.xml
4. Delete or rename Document.zip (we're gonna recreate it in a minute)
5. Now you can edit the text in (all your) "content.xml" file(s)
Use a text editor or tools of your choice. Notepad will do for a single file, but can't do a global find & replace across multiple files, however
all serious editors can.
(You can also easily and accurately edit styles and colours etc, by editing the text in the "styles.xml" files).
6. Zip up the "Document" directory/folder to recreate Document.zip.
YOU CANNOT USE WINDOWS' IN-BUILT ZIP FOLDER SUPPORT FOR THIS
Neither can you use 7-zip. OOo will NOT be able to understand the file! I have absolutely no idea why not!
I use infozip's command line zip.exe (which works, is free, and I can supply)
e.g. Run up a windows "Command Prompt" (cmd.exe)
cd to the (e.g.) "Document" directory/folder
zip ..\Document *.*
That will recreate the Document.zip file in the parent directory/folder
7. Rename the new Document.zip back to Document.odt and open the file with OOo to check it's all ok!
Now you're a fledgling Open Document File format hacker!
I find this technique particularly useful for changing and matching colours (by editing the hex RGB
values directly) and making fine adjustments to table and picture dimensions to match-up
accurately.
HTH
Regards
Luc