1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
Dim oXml 'As New MSXML2.DOMDocument
Dim oRac 'Element racine
Dim oEl ' As MSXML2.IXMLDOMElement ' element
Set oXml = CreateObject("MSXML2.DOMDocument")
Set oRac = oXml.createElement("Adresses")
Set oEl = oXml.createElement("Contact")
oEl.setAttribute "Nom", "dubois"
oEl.setAttribute "Prenom", "Jacques"
oEl.setAttribute "Main", "jacques.dubois@Dio.fr"
oRac.appendChild oEl
Set oEl = oXml.createElement("Contact")
oEl.setAttribute "Nom", "dupon"
oEl.setAttribute "Prenom", "Jean"
oEl.setAttribute "Main", "jean.dupont@Dio.fr"
oRac.appendChild oEl
Set oEl = oXml.createElement("Contact")
oEl.setAttribute "Nom", "Monaco"
oEl.setAttribute "Prenom", "Albert"
oEl.setAttribute "Main", "Albert.Monaco@Dio.fr"
oRac.appendChild oEl
oXml.appendChild oRac
oXml.Save "MesAdresses.xml" |
Partager