|
Removing marked text
From NeoWiki
(Difference between revisions)
Revision as of 21:46, 28 November 2005 (edit) Sardisson (Talk | contribs) m (a typo I didn't make, for once :-)) ← Previous diff |
Revision as of 21:50, 28 November 2005 (edit) (undo) Sardisson (Talk | contribs) m (oops, forgot to add the category stuff, too) Next diff → |
||
Line 16: | Line 16: | ||
''This macro was written by Matteo Cavalleri and suggested at the [http://trinity.neooffice.org/modules.php?name=Forums&file=viewtopic&t=2040&highlight= NeoOffice forums] by Fabrizio Venerandi'' | ''This macro was written by Matteo Cavalleri and suggested at the [http://trinity.neooffice.org/modules.php?name=Forums&file=viewtopic&t=2040&highlight= NeoOffice forums] by Fabrizio Venerandi'' | ||
+ | |||
+ | [[Category:NeoOffice/J]][[Category:Tips and Hints]] |
Revision as of 21:50, 28 November 2005
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 Matteo Cavalleri and suggested at the NeoOffice forums by Fabrizio Venerandi