Gets an XML string that contains the contents of the document in the Word Open XML format.
Namespace:
Microsoft.Office.Tools.Word
Assembly:
Microsoft.Office.Tools.Word.v9.0 (in Microsoft.Office.Tools.Word.v9.0.dll)
Visual Basic (Declaration)
<BrowsableAttribute(False)> _
Public ReadOnly Property WordOpenXML As String
Dim instance As Document
Dim value As String
value = instance.WordOpenXML
[BrowsableAttribute(false)]
public string WordOpenXML { get; }
Property Value
Type:
System..::.StringAn XML string that contains the contents of the document in the Word Open XML format.
The following code example retrieves the Open XML content of the current document and saves this XML content into a file in the current directory.
This example is for a document-level customization.
Private Sub GetXMLContent()
' Get XML content
Dim XMLContent As String = Me.WordOpenXML
' Save XML content into a file in the current directory
Dim sw As System.IO.StreamWriter = _
System.IO.File.CreateText("myXMLDoc.xml")
sw.Write(XMLContent)
sw.Close()
End Sub
private void GetXMLContent()
{
// Get XML content
string XMLContent = this.WordOpenXML;
// Save XML content into a file in the current directory
System.IO.StreamWriter sw =
System.IO.File.CreateText(@"myXMLDoc.xml");
sw.Write(XMLContent);
sw.Close();
}
Reference