概要:Set oDoc = New DOMDocumentIf oDoc.Load(XMLOUTPATH) = True Then注释: Save the Doc as another fileWriteBinData DOCOUTPATHMsgBox DOCOUTPATH & “ is created for you.”ElseMsgBox oDoc.parseError.reasonEnd IfEnd SubPrivate Sub Form_Unload(Cancel As Integer)ReleaseObjectsEnd SubPrivate Sub ReleaseObjects()Set oDoc = NothingEnd Sub4. 建立word文档DocInput.doc。5. 保存文档在工程目录下。6. 运行程序点击cmdCreateXML 按钮。一个 XML 文件XmlOuput.xml 就建立了。点击 cmdGetBinary 按钮就可以生成word文档 DocOutput.doc。按照上面的
用vb将word文档生成xml文件并互相转换,标签:电脑技巧大全,电脑技术,http://www.laixuea.comSet oDoc = New DOMDocument
If oDoc.Load(XMLOUTPATH) = True Then
注释: Save the Doc as another file
WriteBinData DOCOUTPATH
MsgBox DOCOUTPATH & “ is created for you.”
Else
MsgBox oDoc.parseError.reason
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
ReleaseObjects
End Sub
Private Sub ReleaseObjects()
Set oDoc = Nothing
End Sub
4. 建立word文档DocInput.doc。
5. 保存文档在工程目录下。
6. 运行程序点击cmdCreateXML 按钮。一个 XML 文件XmlOuput.xml 就建立了。
点击 cmdGetBinary 按钮就可以生成word文档 DocOutput.doc。
按照上面的方法,同样可以将任意的二进制数据存为xml,然后再重新生成二进制数据。可以用于web传输等等可以使用xmlhttp的地方。