john
XLDnaute Impliqué
Bonjour,
J'ai un soucis lors de l'insertion d'un champ texte en vba.
Voici mon code :
Sub test()
com = "Ceci est un test"
call insert_commentaire (com)
End Sub
'----------------------------------------------
Sub insert_commentaire(commentaire)
'insertion de commentaire
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"COMMENTS "" & " & commentaire & " & "", PreserveFormatting:=True"
'J'ai essayé ce qui suit également mais ça marche pas non plus, j'ai juste le mot "ceci" qui s'affiche
' Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"COMMENTS "" & commentaire & "", PreserveFormatting:=True"
End Sub
Et voici le résultat dans mon champ (
& Ceci est un test &
Pouvez-vous me dire comment je peux faire pour obtenir ceci : Ceci est un test
J'ai essayé de différente façon, mais rien à faire (
Merci d'avance.
John
J'ai un soucis lors de l'insertion d'un champ texte en vba.
Voici mon code :
Sub test()
com = "Ceci est un test"
call insert_commentaire (com)
End Sub
'----------------------------------------------
Sub insert_commentaire(commentaire)
'insertion de commentaire
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"COMMENTS "" & " & commentaire & " & "", PreserveFormatting:=True"
'J'ai essayé ce qui suit également mais ça marche pas non plus, j'ai juste le mot "ceci" qui s'affiche
' Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"COMMENTS "" & commentaire & "", PreserveFormatting:=True"
End Sub
Et voici le résultat dans mon champ (
& Ceci est un test &
Pouvez-vous me dire comment je peux faire pour obtenir ceci : Ceci est un test
J'ai essayé de différente façon, mais rien à faire (
Merci d'avance.
John