Piloter dspeech (tts) sous word/vb

Soyez le premier à donner votre avis sur cette source.

Snippet vu 2 430 fois - Téléchargée 17 fois

Contenu du snippet

Mes macros servent à interfacer word et dspeech (convertisseur txt =>>>mp3)
En permettant de changer de voix dans les texte ‘lus’ par les robots de dspeech , a nettoyer les textes, et de rajouter des extraits ou des introS musicaleS qui servent de pAUse dans les lectures (ou plutôt les audio-lecture).
Ancien chef de projet informatique en retraite je suis un peu léger en système (cambouis chez les analystes) Mes macro sont pas terribles j’aimerais par exemple arrêter une macro en fin de fichier ou afficher un compteur de boucle pendant une exécution

Source / Exemple :


Sub marque()
'
' nettoie Macro
' Macro enregistrée le 10/07/2008 par am
'
    
    Selection.WholeStory
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    
    Selection.GoTo What:=wdGoToPage, Which:=wdGoToNext, Name:="1"
    Selection.TypeParagraph
    Selection.MoveUp Unit:=wdLine, Count:=1
    Selection.TypeText Text:="texte phonétisé par Amicxjo le "
    Selection.InsertDateTime DateTimeFormat:="dddd d MMMM yyyy", InsertAsField _
        :=False, DateLanguage:=wdFrench, CalendarType:=wdCalendarWestern, _
        InsertAsFullWidth:=False
    Selection.TypeText Text:=" à "
    Selection.InsertDateTime DateTimeFormat:="HH:mm", InsertAsField:=False, _
        DateLanguage:=wdFrench, CalendarType:=wdCalendarWestern, _
        InsertAsFullWidth:=False
    Selection.TypeText Text:=" poids du texte :"
    
    Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
        "FILESIZE ", PreserveFormatting:=True
    Selection.TypeText Text:=" octets;   nb de page: "
    Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
        "NUMPAGES ", PreserveFormatting:=True
    Selection.TypeText Text:=", soit environ :"
    Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
        "NUMWORDS ", PreserveFormatting:=True
    Selection.TypeText Text:=" mots ; très bonne audio-lecture..."
    Selection.WholeStory
    With Selection.Font
        .Name = "Arial"
        .Size = 10
        .Bold = False
        .Italic = False
        .Color = wdColorBlue
        End With
        Selection.MoveDown Unit:=wdScreen, Count:=999
    Selection.TypeParagraph
    Selection.TypeText Text:= _
        "salut mek. tes nombreux robots lecteurs trés attentif à leur lecture... 3, 2 , 1, 0..."
           Selection.TypeText Text:=" '<SILENCE MSEC=""800""/>' "
    Selection.WholeStory
    Selection.Copy
    
End Sub
Sub colle()
'
' colle Macro
' Macro enregistrée le 10/07/2008 par am
'
 Selection.PasteSpecial Link:=False, DataType:=wdPasteText, Placement:= _
        wdInLine, DisplayAsIcon:=False
        With Selection.Find
        .Text = " ^p"
        .Replacement.Text = "^p"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
            Selection.Find.Execute Replace:=wdReplaceAll
    With Selection.Find
        .Text = "^p^p"
        .Replacement.Text = "^p"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
            Selection.Find.Execute Replace:=wdReplaceAll
        'elimin 1 chiffre11111111111111111111111
    With Selection.Find
        .Text = "^p^#^p"
        .Replacement.Text = "'<SILENCE MSEC=""500""/>' ^t"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
            Selection.Find.Execute Replace:=wdReplaceAll
    'elimin 2 chiffre2222222222222222222222222
            With Selection.Find
        .Text = "^p^#^#^p"
        .Replacement.Text = "'<SILENCE MSEC=""500""/>' ^t"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
            Selection.Find.Execute Replace:=wdReplaceAll
    'elimin 3 chiffre3333333333333333
            With Selection.Find
        .Text = "^p^#^#^#^p"
        .Replacement.Text = "'<SILENCE MSEC=""500""/>' ^t"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
            Selection.Find.Execute Replace:=wdReplaceAll
    'elimin 1 chiffre
    With Selection.Find
        .Text = "- ^# -"
        .Replacement.Text = "'<SILENCE MSEC=""500""/>' ^t"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
            Selection.Find.Execute Replace:=wdReplaceAll
    'elimin 2 chiffre
            With Selection.Find
        .Text = "- ^#^# -"
        .Replacement.Text = "'<SILENCE MSEC=""500""/>' ^t"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
            Selection.Find.Execute Replace:=wdReplaceAll
    'elimin 3 chiffre
            With Selection.Find
        .Text = "- ^#^#^# -"
        .Replacement.Text = "'<SILENCE MSEC=""500""/>' ^t"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
            Selection.Find.Execute Replace:=wdReplaceAll
    With Selection.Find
        .Text = "^t"
        .Replacement.Text = "^p '<SILENCE MSEC=""200""/>' ^t"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
              Selection.Find.Execute Replace:=wdReplaceAll
    With Selection.Find
        .Text = "^n"
        .Replacement.Text = "^p"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
                   Selection.Find.Execute Replace:=wdReplaceAll
         With Selection.Find
        .Text = "^b"
        .Replacement.Text = "^p '<SILENCE MSEC=""500""/>' ^t"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
                Selection.Find.Execute Replace:=wdReplaceAll
         With Selection.Find
        .Text = "^l"
        .Replacement.Text = "^p '<SILENCE MSEC=""300""/>' ^t"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
       Selection.Find.Execute Replace:=wdReplaceAll
    With Selection.Find
        .Text = "^p^p"
        .Replacement.Text = "^p '<SILENCE MSEC=""400""/>' ^t"
        .Forward = False
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = True
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
         Selection.Find.Execute Replace:=wdReplaceAll
         Selection.TypeParagraph
         With Selection.Find
        '22222222222222222222
        .Text = "^m"
        .Replacement.Text = "^p '<SILENCE MSEC=""599""/>' ^t"
        .Forward = False
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = True
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    With Selection.Find
        .Text = "^p"
        .Replacement.Text = " "
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
            Selection.Find.Execute Replace:=wdReplaceAll
         Selection.Find.Execute Replace:=wdReplaceAll
         Selection.TypeParagraph
         Selection.WholeStory
        With Selection.Font
        .Name = "Arial"
        .Size = 10
        .Bold = False
        .Italic = True
        .Color = wdColorBlue
        End With
        Selection.MoveDown Unit:=wdLine, Count:=1
    Selection.TypeParagraph
    Selection.TypeText Text:="fin de l'histoire en voici une nouvelle....."
    Selection.TypeParagraph
        Selection.MoveDown Unit:=wdLine, Count:=1
        Selection.TypeParagraph
        Selection.TypeText Text:="'<SILENCE MSEC=""400""/>' ^t"
        Selection.MoveLeft Unit:=wdWord, Count:=7, Extend:=wdExtend
With Selection.Font
        .Name = "Arial"
        .Size = 12
        .Bold = True
        .Italic = False
        .Color = wdColorRed
        End With
        
        
End Sub

Sub Muzik()
'
 Selection.GoTo What:=wdGoToLine, Which:=wdGoToFirst, Count:=2, Name:=""
 For i = 1 To 69
Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "'<SILENCE MSEC=""^#^#^#""/>'"
        '.Text = "^#^#^#"
        .Replacement.Text = "^p#PLAY ""E:\bruits\bulles.mp3""^p"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    With Selection
        If .Find.Forward = True Then
            .Collapse Direction:=wdCollapseStart
        Else
            .Collapse Direction:=wdCollapseEnd
        End If
        .Find.Execute Replace:=wdReplaceOne
        If .Find.Forward = True Then
            .Collapse Direction:=wdCollapseEnd
        Else
            .Collapse Direction:=wdCollapseStart
        End If
        .Find.Execute
    End With
    '222222222222222222222
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "'<SILENCE MSEC=""^#^#^#""/>'"
        .Replacement.Text = "^p#PLAY ""E:\bruits\TrainHorn.wav""^p"
        .Forward = True
       .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    With Selection
        If .Find.Forward = True Then
            .Collapse Direction:=wdCollapseStart
        Else
            .Collapse Direction:=wdCollapseEnd
        End If
        .Find.Execute Replace:=wdReplaceOne
        If .Find.Forward = True Then
            .Collapse Direction:=wdCollapseEnd
        Else
            .Collapse Direction:=wdCollapseStart
        End If
        .Find.Execute
    End With
    '333333333333333333333333333333
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "'<SILENCE MSEC=""^#^#^#""/>'"
        .Replacement.Text = "^p#PLAY ""E:\bruits\duck.wav""^p"
        .Forward = True
.Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    With Selection
        If .Find.Forward = True Then
            .Collapse Direction:=wdCollapseStart
        Else
            .Collapse Direction:=wdCollapseEnd
        End If
        .Find.Execute Replace:=wdReplaceOne
        If .Find.Forward = True Then
            .Collapse Direction:=wdCollapseEnd
        Else
            .Collapse Direction:=wdCollapseStart
        End If
        .Find.Execute
    End With
    '3bis3bis3bis3bis3bis3bis
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "'<SILENCE MSEC=""^#^#^#""/>'"
        .Replacement.Text = "^p#PLAY ""E:\bruits\1markiz.mp3""^p"
        .Forward = True
.Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    With Selection
        If .Find.Forward = True Then
            .Collapse Direction:=wdCollapseStart
        Else
            .Collapse Direction:=wdCollapseEnd
        End If
        .Find.Execute Replace:=wdReplaceOne
        If .Find.Forward = True Then
            .Collapse Direction:=wdCollapseEnd
        Else
            .Collapse Direction:=wdCollapseStart
        End If
        .Find.Execute
    End With
    '444444444444444444444444444444444
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "'<SILENCE MSEC=""^#^#^#""/>'"
        .Replacement.Text = "^p#PLAY ""E:\bruits\Mystery.wav""^p"
        .Forward = True
 .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    With Selection
        If .Find.Forward = True Then
            .Collapse Direction:=wdCollapseStart
        Else
            .Collapse Direction:=wdCollapseEnd
        End If
        .Find.Execute Replace:=wdReplaceOne
        If .Find.Forward = True Then
            .Collapse Direction:=wdCollapseEnd
        Else
            .Collapse Direction:=wdCollapseStart
        End If
        .Find.Execute
    End With
    '55555555555555555555555555
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "'<SILENCE MSEC=""^#^#^#""/>'"
        .Replacement.Text = "^p#PLAY ""E:\bruits\brel_fin_forc-aimer.wav""^p"
        .Forward = True
       .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    With Selection
        If .Find.Forward = True Then
            .Collapse Direction:=wdCollapseStart
        Else
            .Collapse Direction:=wdCollapseEnd
        End If
        .Find.Execute Replace:=wdReplaceOne
        If .Find.Forward = True Then
            .Collapse Direction:=wdCollapseEnd
        Else
            .Collapse Direction:=wdCollapseStart
        End If
        .Find.Execute
    End With
    '7777777777777777777777777
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "'<SILENCE MSEC=""^#^#^#""/>'"
        .Replacement.Text = "^p#PLAY ""E:\bruits\deb-v_zaman.wav""^p"
        .Forward = True
       .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    With Selection
        If .Find.Forward = True Then
            .Collapse Direction:=wdCollapseStart
        Else
            .Collapse Direction:=wdCollapseEnd
        End If
        .Find.Execute Replace:=wdReplaceOne
        If .Find.Forward = True Then
            .Collapse Direction:=wdCollapseEnd
        Else
            .Collapse Direction:=wdCollapseStart
        End If
        .Find.Execute
    End With
    'n1<<<<<<<<<<<<<<<
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "'<SILENCE MSEC=""^#^#^#""/>'"
        .Replacement.Text = "^p#PLAY ""E:\bruits\deb_dutron.mp3""^p"
        .Forward = True
       .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    With Selection
        If .Find.Forward = True Then
            .Collapse Direction:=wdCollapseStart
        Else
            .Collapse Direction:=wdCollapseEnd
        End If
        .Find.Execute Replace:=wdReplaceOne
        If .Find.Forward = True Then
            .Collapse Direction:=wdCollapseEnd
        Else
            .Collapse Direction:=wdCollapseStart
        End If
        .Find.Execute
    End With
    'n2<<<<<<<<<<<
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "'<SILENCE MSEC=""^#^#^#""/>'"
        .Replacement.Text = "^p#PLAY ""E:\bruits\deb_kinks.mp3""^p"
        .Forward = True
       .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    With Selection
        If .Find.Forward = True Then
            .Collapse Direction:=wdCollapseStart
        Else
            .Collapse Direction:=wdCollapseEnd
        End If
        .Find.Execute Replace:=wdReplaceOne
        If .Find.Forward = True Then
            .Collapse Direction:=wdCollapseEnd
        Else
            .Collapse Direction:=wdCollapseStart
        End If
        .Find.Execute
    End With
    'n3<<<<<<<<<<<<<<<
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "'<SILENCE MSEC=""^#^#^#""/>'"
        .Replacement.Text = "^p#PLAY ""E:\bruits\deb_madonna.mp3""^p"
        .Forward = True
       .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    With Selection
        If .Find.Forward = True Then
            .Collapse Direction:=wdCollapseStart
        Else
            .Collapse Direction:=wdCollapseEnd
        End If
        .Find.Execute Replace:=wdReplaceOne
        If .Find.Forward = True Then
            .Collapse Direction:=wdCollapseEnd
        Else
            .Collapse Direction:=wdCollapseStart
        End If
        .Find.Execute
    End With
    'n4<<<<<<<<<<<
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "'<SILENCE MSEC=""^#^#^#""/>'"
        .Replacement.Text = "^p#PLAY ""E:\bruits\deb_toreador.wav""^p"
        .Forward = True
       .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    With Selection
        If .Find.Forward = True Then
            .Collapse Direction:=wdCollapseStart
        Else
            .Collapse Direction:=wdCollapseEnd
        End If
        .Find.Execute Replace:=wdReplaceOne
        If .Find.Forward = True Then
            .Collapse Direction:=wdCollapseEnd
        Else
            .Collapse Direction:=wdCollapseStart
        End If
        .Find.Execute
    End With
    'n5<<<<+++++++++++++<<<<<
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "'<SILENCE MSEC=""^#^#^#""/>'"
        .Replacement.Text = "^p#PLAY ""E:\bruits\c-et-e2.mp3""^p"
        .Forward = True
       .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    With Selection
        If .Find.Forward = True Then
            .Collapse Direction:=wdCollapseStart
        Else
            .Collapse Direction:=wdCollapseEnd
        End If
        .Find.Execute Replace:=wdReplaceOne
        If .Find.Forward = True Then
            .Collapse Direction:=wdCollapseEnd
        Else
            .Collapse Direction:=wdCollapseStart
        End If
        .Find.Execute
    End With
    'n6<<<<<<<<<<<
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "'<SILENCE MSEC=""^#^#^#""/>'"
        .Replacement.Text = "^p#PLAY ""E:\bruits\deb-mirza.mp3""^p"
        .Forward = True
       .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    With Selection
        If .Find.Forward = True Then
            .Collapse Direction:=wdCollapseStart
        Else
            .Collapse Direction:=wdCollapseEnd
        End If
        .Find.Execute Replace:=wdReplaceOne
        If .Find.Forward = True Then
            .Collapse Direction:=wdCollapseEnd
        Else
            .Collapse Direction:=wdCollapseStart
        End If
        .Find.Execute
    End With
    'n1<<
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "'<SILENCE MSEC=""^#^#^#""/>'"
        .Replacement.Text = "^p#PLAY ""E:\bruits\deb-tek-five.mp3""^p"
        .Forward = True
       .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    With Selection
        If .Find.Forward = True Then
            .Collapse Direction:=wdCollapseStart
        Else
            .Collapse Direction:=wdCollapseEnd
        End If
        .Find.Execute Replace:=wdReplaceOne
        If .Find.Forward = True Then
            .Collapse Direction:=wdCollapseEnd
        Else
            .Collapse Direction:=wdCollapseStart
        End If
        .Find.Execute
    End With
    'n2<<<+++++++++++++++
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "'<SILENCE MSEC=""^#^#^#""/>'"
        .Replacement.Text = "^p#PLAY ""E:\bruits\c-et-e.mp3""^p"
        .Forward = True
       .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    With Selection
        If .Find.Forward = True Then
            .Collapse Direction:=wdCollapseStart
        Else
            .Collapse Direction:=wdCollapseEnd
        End If
        .Find.Execute Replace:=wdReplaceOne
        If .Find.Forward = True Then
            .Collapse Direction:=wdCollapseEnd
        Else
            .Collapse Direction:=wdCollapseStart
        End If
        .Find.Execute
    End With
         '.Text = "'<SILENCE MSEC=""^#^#^#""/>'"
        '.Replacement.Text = "^p#PLAY ""E:\bruits\coyotte.wav"""
        '
        '.Replacement.Text = "^p#PLAY ""E:\bruits\sirene.mp3"""
        '
        '.Replacement.Text = "^p#PLAY ""E:\bruits\bruitdeporte.wav""^p"
        '
        '.Replacement.Text = "^p#PLAY ""E:\bruits\chasse.wav""^p"
        '
        '.Replacement.Text = "^p#PLAY ""E:\bruits\bulles.mp3""^p"
        '
  Next i
End Sub

Sub Cxm()
'
' ins Macro CcGgHhJjSsUuHh
    Selection.InsertSymbol CharacterNumber:=264, Unicode:=True
End Sub
Sub Cx()
'
' ins Macro
' CcGgHhJjSsUuHh
'
   
    Selection.InsertSymbol CharacterNumber:=265, Unicode:=True
    
End Sub
Sub Gxm()
'
' ins Macro
' CcGgHhJjSsUuHh
'
    
    Selection.InsertSymbol CharacterNumber:=284, Unicode:=True
    
End Sub
Sub Gx()
'
' ins Macro
' CcGgHhJjSsUuHh
'
    
    Selection.InsertSymbol CharacterNumber:=285, Unicode:=True
    
End Sub
Sub sxm()
'
' ins MacroCcGgHhJjSsUuHh
' Macro enregistrée le 07/10/2008
'
    
    Selection.InsertSymbol CharacterNumber:=348, Unicode:=True
    
End Sub
Sub sx()
'
' ins Macro
' CcGgHhJjSsUuHh
'
    
    Selection.InsertSymbol CharacterNumber:=349, Unicode:=True
    
End Sub
Sub jxm()
'
' ins Macro
' CcGgHhJjSsUuHh
'
    Selection.InsertSymbol CharacterNumber:=308, Unicode:=True
    
End Sub

Sub jx()
'
' ins Macro
' CcGgHhJjSsUuHh
'
    
    Selection.InsertSymbol CharacterNumber:=309, Unicode:=True
    
    
End Sub
Sub ins()
' CcGgHhJjSsUuHh
    Selection.InsertSymbol CharacterNumber:=348, Unicode:=True
    
End Sub
Sub uxm()

' CcGgHhJjSsUuHh
'
    
    
    Selection.InsertSymbol CharacterNumber:=364, Unicode:=True
    
    
End Sub
Sub ux()
' CcGgHhJjSsUuHh
    
   Selection.InsertSymbol CharacterNumber:=365, Unicode:=True
    
    
End Sub
Sub hxm()
'CcGgHhJjSsUuHh
   
    Selection.InsertSymbol CharacterNumber:=292, Unicode:=True
    
    
End Sub
Sub hx()
'CcGgHhJjSsUuHh
   
    Selection.InsertSymbol CharacterNumber:=293, Unicode:=True
   
End Sub

Sub colll()
'
' colll Macro
' Macro enregistrée le 07/10/2008 par us govertment
'
    Selection.PasteSpecial Link:=False, DataType:=wdPasteText, Placement:= _
        wdInLine, DisplayAsIcon:=False
End Sub
Sub paorolii()
'
' paorolii
    Selection.WholeStory
    Selection.Range.Case = wdLowerCase
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "c"
        .Replacement.Text = "ts"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    ' paorolii2*gxgxgxgxgxgxgxgxgxgx
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = ChrW(285) & "e"
        .Replacement.Text = "ge"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    ' paorolii3*gxgxgxgxgxgxgxgxgxgx
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = ChrW(265) & "i"
        .Replacement.Text = "gi"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    ' paoroliicxcxcxcxcxcxcxcxcxc
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = ChrW(265) & "e"
        .Replacement.Text = "ce"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    ' paorolii
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = ChrW(285) & "i"
        .Replacement.Text = "ci"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    ' paorolii ux
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = ChrW(365)
        .Replacement.Text = "uo"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
 ' paorolii sx sx
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = ChrW(348) & "i"
        .Replacement.Text = "sci"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    
End Sub
Sub y()
'
' y Macro
' Macro enregistrée le 09/11/2008 par cia-fbi
'
    For u = 1 To 999
    Selection.TypeText Text:="fin de l'histoire en voici une nouvelle....."
    Selection.TypeParagraph
    Selection.MoveDown Unit:=wdLine, Count:=1
    If EOF(1) Then GoTo fin
    Next u
: fin
    
End Sub

Sub latotale()
'
' appelmac Macro
' Macro enregistrée le 09/12/2008 par sarkobush
    Application.Run MacroName:="Muzik"
    Application.Run MacroName:="voix_chgt"
    Application.Run MacroName:="marque"
End Sub
Sub voix_chgt()
'
' voix_chgt Macro
' Macro enregistrée le 09/12/2008 par sarkobush
'
    Selection.MoveUp Unit:=wdScreen, Count:=199
    For ii = 1 To 69
    'SEBASTIEN1
    With Selection.Find
        .Text = "^t"
        .Replacement.Text = "^p#VOICE ScanSoft Sebastien Full 22kHz^p"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    With Selection
        If .Find.Forward = True Then
            .Collapse Direction:=wdCollapseStart
        Else
            .Collapse Direction:=wdCollapseEnd
        End If
        .Find.Execute Replace:=wdReplaceOne
        If .Find.Forward = True Then
            .Collapse Direction:=wdCollapseEnd
        Else
            .Collapse Direction:=wdCollapseStart
        End If
        .Find.Execute
    End With
    'VIRGINIE
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "^t"
        .Replacement.Text = "^p#VOICE ScanSoft Virginie Full 22kHz^p"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute
    With Selection
        If .Find.Forward = True Then
            .Collapse Direction:=wdCollapseStart
        Else
            .Collapse Direction:=wdCollapseEnd
        End If
        .Find.Execute Replace:=wdReplaceOne
        If .Find.Forward = True Then
            .Collapse Direction:=wdCollapseEnd
        Else
            .Collapse Direction:=wdCollapseStart
        End If
        .Find.Execute
    End With
    'JULIE
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "^t"
        .Replacement.Text = "^p#VOICE ScanSoft Julie Full 22kHz^p"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute
    With Selection
        If .Find.Forward = True Then
            .Collapse Direction:=wdCollapseStart
        Else
            .Collapse Direction:=wdCollapseEnd
        End If
        .Find.Execute Replace:=wdReplaceOne
        If .Find.Forward = True Then
            .Collapse Direction:=wdCollapseEnd
        Else
            .Collapse Direction:=wdCollapseStart
        End If
        .Find.Execute
    End With
    'SEBASTIEN2
    With Selection.Find
        .Text = "^t"
        .Replacement.Text = "^p#VOICE ScanSoft Sebastien Full 22kHz^p"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    With Selection
        If .Find.Forward = True Then
            .Collapse Direction:=wdCollapseStart
        Else
            .Collapse Direction:=wdCollapseEnd
        End If
        .Find.Execute Replace:=wdReplaceOne
        If .Find.Forward = True Then
            .Collapse Direction:=wdCollapseEnd
        Else
            .Collapse Direction:=wdCollapseStart
        End If
        .Find.Execute
    End With
    
    'CLAIRE
    With Selection.Find
        .Text = "^t"
        .Replacement.Text = "^p#VOICE Acapela Telecom HQ TTS French (Claire 22 kHz)^p"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    With Selection
        If .Find.Forward = True Then
            .Collapse Direction:=wdCollapseStart
        Else
            .Collapse Direction:=wdCollapseEnd
        End If
        .Find.Execute Replace:=wdReplaceOne
        If .Find.Forward = True Then
            .Collapse Direction:=wdCollapseEnd
        Else
            .Collapse Direction:=wdCollapseStart
        End If
        .Find.Execute
    End With
    
    Next ii
End Sub

Conclusion :


j'espère que je n'effraierai pas le lecteur de ses macros vb rudimentaires (je suis un ancien du cobol et des cartes perforés! un dinosaure! )
en espérant votre indulgence....
bien a vous
amicxjo

A voir également

Ajouter un commentaire

Commentaire

Messages postés
2
Date d'inscription
samedi 28 janvier 2006
Statut
Membre
Dernière intervention
10 septembre 2009

Bonjour,

Comment ça marche ? Ça manque cruellement de commentaires...

Merci d'avance pour quelques explications complémentaires

JC

Vous n'êtes pas encore membre ?

inscrivez-vous, c'est gratuit et ça prend moins d'une minute !

Les membres obtiennent plus de réponses que les utilisateurs anonymes.

Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.

Le fait d'être membre vous permet d'avoir des options supplémentaires.