Removing marked text

From NeoWiki

Revision as of 14:55, 10 February 2007 by Valterb (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

NeoOffice has powerful search and replace functions, but removing various section of marked ([bracketed] text, for instance) cannot be done with the basic functions.

You could use the following macro for this:

sub seekanddestroy4
dim seek
seek = thiscomponent.createReplaceDescriptor()
seek.SearchString = "\[[^\[\]]+\]"
seek.ReplaceString = ""
seek.SearchRegularExpression=True
thiscomponent.ReplaceAll(seek)
end sub

The macro will seek all sections of text in brackets [like a suggestion for different text] and replace these with an empty string [no characters].

This macro was written by Fabrizio Venerandi (with a small improvement by Matteo Cavalleri) and suggested at the NeoOffice forums



This article in other languages: Français Deutsch Italiano
Personal tools