Sub InsertionEntreParentheses()
Selection.Paragraphs.First.Range.InsertBefore "("
Selection.Paragraphs.First.Range.Characters.Last.InsertBefore ")"
Selection.MoveRight Unit:=wdCharacter, Count:=2
End Sub
qui le fait très bien
Mais comment pourrais-je faire pour déterminer si ce paragraphe en question
n'est pas déjà entouré de parenthèses, afin d'éviter les répétitions
possibles : ((Mon paragraphe)) ?
Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
Rémi
Bonjour
Essaies le code suivant
Sub InsertionEntreParentheses( Selection.HomeKey Unit:=wdLin Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExten If Selection.Text <> "(" The Selection.Paragraphs.First.Range.InsertBefore "( Selection.Paragraphs.First.Range.Characters.Last.InsertBefore ") Selection.MoveRight Unit:=wdCharacter, Count: End I End Su
Cordialement
Rémi
----- Serge Hipontoise wrote: ----
Sub InsertionEntreParentheses( Selection.Paragraphs.First.Range.InsertBefore "( Selection.Paragraphs.First.Range.Characters.Last.InsertBefore ") Selection.MoveRight Unit:=wdCharacter, Count: End Su
qui le fait très bie
Mais comment pourrais-je faire pour déterminer si ce paragraphe en questio n'est pas déjà entouré de parenthèses, afin d'éviter les répétition possibles : ((Mon paragraphe))
Merc
Serg
Bonjour
Essaies le code suivant
Sub InsertionEntreParentheses(
Selection.HomeKey Unit:=wdLin
Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExten
If Selection.Text <> "(" The
Selection.Paragraphs.First.Range.InsertBefore "(
Selection.Paragraphs.First.Range.Characters.Last.InsertBefore ")
Selection.MoveRight Unit:=wdCharacter, Count: End I
End Su
Cordialement
Rémi
----- Serge Hipontoise wrote: ----
Sub InsertionEntreParentheses(
Selection.Paragraphs.First.Range.InsertBefore "(
Selection.Paragraphs.First.Range.Characters.Last.InsertBefore ")
Selection.MoveRight Unit:=wdCharacter, Count: End Su
qui le fait très bie
Mais comment pourrais-je faire pour déterminer si ce paragraphe en questio
n'est pas déjà entouré de parenthèses, afin d'éviter les répétition
possibles : ((Mon paragraphe))
Sub InsertionEntreParentheses( Selection.HomeKey Unit:=wdLin Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExten If Selection.Text <> "(" The Selection.Paragraphs.First.Range.InsertBefore "( Selection.Paragraphs.First.Range.Characters.Last.InsertBefore ") Selection.MoveRight Unit:=wdCharacter, Count: End I End Su
Cordialement
Rémi
----- Serge Hipontoise wrote: ----
Sub InsertionEntreParentheses( Selection.Paragraphs.First.Range.InsertBefore "( Selection.Paragraphs.First.Range.Characters.Last.InsertBefore ") Selection.MoveRight Unit:=wdCharacter, Count: End Su
qui le fait très bie
Mais comment pourrais-je faire pour déterminer si ce paragraphe en questio n'est pas déjà entouré de parenthèses, afin d'éviter les répétition possibles : ((Mon paragraphe))