Modifier une valeur dans un fichier xml
Bonjour,
Alors j'ai un fichier configuration.xml contenant un élément CaptureDir :
<CaptureDir>"C:\Documents and Settings\administrateur\Mes documents\PrintScreen Files"</CaptureDir>
Mon but est de remplacer administrateur par toto et c'est là tous le problème :(
Voilà mon bout de code :
Code:
1 2 3 4 5 6 7 8 9 10 11
| Set xmlDoc = CreateObject("Microsoft.XMLDOM")
xmlDoc.async = "false"
xmlDoc.load("configuration.xml")
Set oElement = xmlDoc.documentElement
If Not oElement Is Nothing Then
For Each x In oElement.getElementsByTagName("CaptureDir")
MsgBox x.Text
Next
End If
xmlDoc.save ("configuration.xml")
Set xmlDoc = Nothing |
J'arrive bien à me positionner sur la bonne ligne mais je ne sait pas comment la modifier :roll: