Share via


Document.WordOpenXML Property (2007 System)

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)

Syntax

'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property WordOpenXML As String
'Usage
Dim instance As Document 
Dim value As String 

value = instance.WordOpenXML
[BrowsableAttribute(false)]
public string WordOpenXML { get; }
[BrowsableAttribute(false)]
public:
property String^ WordOpenXML {
    String^ get ();
}
public function get WordOpenXML () : String

Property Value

Type: System.String
An XML string that contains the contents of the document in the Word Open XML format.

Examples

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();
}

.NET Framework Security

See Also

Reference

Document Class

Document Members

Microsoft.Office.Tools.Word Namespace