5 messages in org.openoffice.fr.progTransformer une macro
FromSent OnAttachments
Jean SympaDec 19, 2006 1:12 am 
Bernard MarcellyDec 19, 2006 3:17 am 
yves dutrieuxDec 19, 2006 4:28 am 
Jean SympaDec 19, 2006 6:06 am 
Laurent GodardDec 19, 2006 6:33 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Transformer une macroActions...
From:Jean Sympa (jsy@free.fr)
Date:Dec 19, 2006 1:12:08 am
List:org.openoffice.fr.prog

Bonjour à toutes et à tous,

Transformer une macro

La macro suivante, mise au point grâce à votre aide, permet de dénombrer, dans un texte, des sous chaînes situées à l'intérieur d'un texte. Par exemple [=20], [=E9], [=E8] etc..

Je voudrais la modifier pour qu'elle remplace les occurrences de:

=20 par un caractère vierge

=E9 par é

=E8 par è

.................

Option Explicit

Sub TrouverToutPartout()

Dim monDocument as Object

Dim jeCherche As Object, trouv As Variant

Dim x As Long

monDocument=ThisComponent

jeCherche=monDocument.createSearchDescriptor

with jeCherche

.SearchString= "=E8"

.SearchWords=false

end with

trouv=monDocument.findAll(jeCherche)

print "Nombre d'occurences: " & cstr(trouv.count)

for x=0 to trouv.count-1

trouv(x).CharBackColor=1234567 'Fond vert sombre

next

End Sub

Que faut-il modifier?

Question complémentaire

Pourrais-je remplacer le titre de la macro

Sub TrouverToutPartout()

par Sub TrouverRemplacerToutPartout()?

Avec mes remerciements

Cordialement

Papy