5 messages in org.openoffice.fr.prog[Calc] Macros suite discussion entamé...
FromSent OnAttachments
Gérard LalouxNov 19, 2006 1:48 am 
christianwtdNov 19, 2006 2:15 am 
Gérard LalouxNov 19, 2006 2:32 am 
christianwtdNov 19, 2006 4:09 am 
Gérard LalouxNov 19, 2006 5:14 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:[Calc] Macros suite discussion entamée sur usersActions...
From:Gérard Laloux (gera@euphonynet.be)
Date:Nov 19, 2006 1:48:10 am
List:org.openoffice.fr.prog

Yeps, J'aimerais pouvoir reprendre une discussion entamée sur users avec Christian alias "Christianwtd".

Macro destinée à supprimer des caractères accentués.

Merci Christian, cela correspond /pratiquement/ à ce dont j'ai besoin. /++ Quelques questions dans le code que tu m'as envoyé >>/

Sub SupprimeAccents Dim oDocument As Object, oSheet As Object Dim oCell As Object Dim Col As Integer, Lig As Integer, i As Integer Dim LigDeb As Integer, LigFin As Integer ' Col = 0 /J'aimerais pouvoir faire exécuter la macro sur plusieurs colonnes Je suppose que pour cela, il "envelopper" le "for next" des lignes par un autre "for next" pour les colonnes ?? / LigDeb = 0 LigFin = 100 ' oDocument=ThisComponent /oSheet=oDocument.currentController.ActiveSheet //J'ai modifié la ligne ci-dessus pour que la macro s'exécute quelle que soit la feuille/ ' For i = LigDeb to LigFin Txt = oSheet.getCellByPosition(Col, i).getString Nc = Len(Txt) For n = 1 to Nc Car = Mid(Txt, n, 1) If Car = "é" Or Car ="è" Or Car = "ê" Or Car = "ë" Then Car = "e" Mid(Txt, n, 1) = Car oSheet.getCellByPosition(Col, i).setString(Txt) /Pourquoi cette dernière ligne n'est-elle pas présente dans le elseif suivant ??/ ElseIf Car = "â" Or Car ="à" Or Car ="ä" Then Car = "a" Mid(Txt, n, 1) = Car ElseIf Car = "ï" Or Car ="î" Then Car = "i" Mid(Txt, n, 1) = Car oSheet.getCellByPosition(Col, i).setString(Txt) ElseIf Car = "_" Or Car ="-" Then Car = "" Mid(Txt, n, 1) = Car oSheet.getCellByPosition(Col, i).setString(Txt) Nc = Nc - 1 Endif Next n Next i End Sub

Bon dimanche,