Hi,
I'm trying to update a value which is stored in a xml file.
Preferable through a popup where the input (new value) is typed in.
Any help is much aprreciated!
This is what I have found, but not working..
I'm trying to update a value which is stored in a xml file.
Preferable through a popup where the input (new value) is typed in.
Any help is much aprreciated!
This is what I have found, but not working..
Code:
'Define what our new value will be and place it into a variable
sValue = "Testvalue"
'Get path of script, (scriptfullname), then replace the scriptname with nothing bring us only the path and place it into strScriptPath
strScriptPath = replace(wscript.scriptfullname,wscript.scriptname,"")
'Create XMLDoc object
Set xmlDoc = CreateObject("Microsoft.XMLDOM")
'load up the XML file and place it into xmldoc
xmlDoc.load strScriptPath & "config.xml"
'Select the node we want to edit
'The text IS case sensitive
Set sInboxFolder = xmlDoc.selectsinglenode ("registration")
'Show the current value in FaxInBox
msgbox sInboxFolder.text
'Set the text node with the new value
sInboxFolder.text = sValue
'Save the xml document with the new settings.
iResult = xmldoc.save(strScriptPath & "config.xml")
'You can use the iResult as a way to determine if the file gets saved correctly or not (‘0=yes’, ‘1=no’)