Removing marked text

From NeoWiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 21:12, 28 November 2005 (edit)
Ovvldc ( | contribs)

← Previous diff
Current revision (14:55, 10 February 2007) (edit) (undo)
Valterb (Talk | contribs)
(botlangbar -> IT)
 
(7 intermediate revisions not shown.)
Line 13: Line 13:
</nowiki></pre> </nowiki></pre>
-The macro will seek all sections of text in brackets [like a suggestion for different text] and replace these with and empty string [no characters]. +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 wiki by Fabrizio Venerandi''+''This macro was written by Fabrizio Venerandi (with a small improvement by Matteo Cavalleri) and suggested at the [http://trinity.neooffice.org/modules.php?name=Forums&file=viewtopic&t=2040 NeoOffice forums]''
 + 
 + 
 +{{botlangbarEN|[[Fr:Supprimer du texte délimité|Français]] [[De:Markierte_Textabschnitte_entfernen|Deutsch]] [[It:rimuovere_testo_delimitato|Italiano]]}}
 +[[Category:NeoOffice]][[Category:Tips and Hints]]

Current revision

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