就放在前面就可以了。 Private Sub SaveValues() Dim xml_document As DOMDocument Dim values_node As IXMLDOMNode Dim Version As Variant ' Create the XML document. Set xml_document = New DOMDocument Set Version = xml_document.createProcessingInstruction("xml", "version=" & Chr(34) & "1.0" & Chr(34))
xml_document.appendChild Version ' Create the Values section node. Set values_node = xml_document.createElement("Test") ' Add a new line. values_node.appendChild xml_document.createTextNode(vbCrLf) ' Add the Values section node to the document. xml_document.appendChild values_node ' Create nodes for the values inside the ' Values section node. 'CreateNode 4, values_node, "FirstName", c 'CreateNode 4, values_node, "LastName", c 'CreateNode 4, values_node, "Street", c 'CreateNode 4, values_node, "City", c 'CreateNode 4, values_node, "State", c 'CreateNode 4, values_node, "Zip", c ' Save the XML document. xml_document.Save m_AppPath & "Values.xml" End Sub |