4 messages in org.openoffice.fr.progRE: [prog] Problème très urgent .... ...
FromSent OnAttachments
Cezame ConceptMar 15, 2006 2:41 am 
emma...@fr.thalesgroup.comMar 15, 2006 8:08 am 
Cezame ConceptMar 15, 2006 8:18 am 
emma...@fr.thalesgroup.comMar 15, 2006 8:31 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:RE: [prog] Problème très urgent .... OLE oOWriterActions...
From:emma...@fr.thalesgroup.com (emma@fr.thalesgroup.com)
Date:Mar 15, 2006 8:08:39 am
List:org.openoffice.fr.prog

Bonjour,

Je pense qu'il suffit de regarder le contenu du résultat obtenu et de voir s'il correspond à la chaîne recherchée. Pour cela, faire oResultat.getString()

Emmanuel

-----Message d'origine----- De : Cezame Concept [mailto:ceza@wanadoo.fr] Envoyé : mercredi 15 mars 2006 11:42 À : pr@fr.openoffice.org Objet : [prog] Problème très urgent .... OLE oOWriter

Je rencontre un problème lorsque j'effectue une recherche 'une chaîne dans un
document oOWriter ...

Je souhaiterai simplement connaître en retour si la chaîne a été trouvée ...

J'utilise cette procédure .. sous VB express 2005

Function Rechercher(ByVal sMots As String, ByVal sRespecterCasse As Boolean,
ByVal sMotEntier As Boolean) As Boolean

Dim oResultat As Object

Dim oDispatcherLocal As Object

Dim oControleur As Object

oSel = oDocument.CurrentController.Frame

oDispatcherLocal = CreateUnoService("com.sun.star.frame.DispatchHelper")

oMonTexte = oDocument.getText()

oControleur = oDocument.CurrentController

oJeCherche = oDocument.createSearchDescriptor

'Definir la balise à rechercher dans le document OpenOffice Word

oJeCherche.SearchString = sMots

'Distinguer les majuscules des minuscules dans la recherche

oJeCherche.SearchCaseSensitive = sRespecterCasse

'Ne rechercher que des mots

oJeCherche.SearchWords = sMotEntier

'Rechercher à reculons

oJeCherche.SearchBackwards = False

'Faire une recherche avec la méthode des expressions régulières

oJeCherche.SearchRegularExpression = True

'Rechercher des paragraphes d'un style donné par SearchString

oJeCherche.SearchStyles = False

'Rechercher un texte similaire au texte cherché

oJeCherche.SearchSimilarity = False

oResultat = oDocument.findFirst(oJeCherche)

'If oResultat Then

' oControleur.select(oMonCurseur)

' Rechercher = True

'Else

' Rechercher = False

'End If

Rechercher = True

End Function

Comment completer cette function ?

Merci d'avance