Document Properties (2007 ...


Visual Studio Tools for Office API Reference
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

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

value = instance.WordOpenXML
C#
[BrowsableAttribute(false)]
public string WordOpenXML { get; }

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.

Visual Basic
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
C#
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();
}
Permissions

See Also

Reference

Tags :


Page view tracker