Udostępnij za pośrednictwem


Document.OpenEncoding Property (2007 System)

Gets the encoding used to open the document.

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 OpenEncoding As MsoEncoding
'Usage
Dim instance As Document 
Dim value As MsoEncoding 

value = instance.OpenEncoding
[BrowsableAttribute(false)]
public MsoEncoding OpenEncoding { get; }
[BrowsableAttribute(false)]
public:
property MsoEncoding OpenEncoding {
    MsoEncoding get ();
}
public function get OpenEncoding () : MsoEncoding

Property Value

Type: MsoEncoding
One of the MsoEncoding values.

Examples

The following code example checks whether the document is a UTF7-encoded document and displays a message that shows the results.

This example is for a document-level customization.

Private Sub DocumentOpenEncoding()
    If Me.OpenEncoding = Microsoft.Office.Core.MsoEncoding.msoEncodingUTF7 Then
        MessageBox.Show("This is a UTF7-encoded text file!")
    Else
        MessageBox.Show("This is not a UTF7-encoded text file!")
    End If 
End Sub
private void DocumentOpenEncoding()
{
    if (this.OpenEncoding == Microsoft.Office.Core.MsoEncoding.msoEncodingUTF7)
    {
        MessageBox.Show("This is a UTF7-encoded text file!");
    }
    else
    {
        MessageBox.Show("This is not a UTF7-encoded text file!");
    }
}

.NET Framework Security

See Also

Reference

Document Class

Document Members

Microsoft.Office.Tools.Word Namespace