Document.TextEncoding Property (2007 System)
Gets or sets the code page, or character set, that Microsoft Office Word uses for a document saved as an encoded text file.
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 Property TextEncoding As MsoEncoding
'Usage
Dim instance As Document
Dim value As MsoEncoding
value = instance.TextEncoding
instance.TextEncoding = value
[BrowsableAttribute(false)]
public MsoEncoding TextEncoding { get; set; }
[BrowsableAttribute(false)]
public:
property MsoEncoding TextEncoding {
MsoEncoding get ();
void set (MsoEncoding value);
}
public function get TextEncoding () : MsoEncoding
public function set TextEncoding (value : MsoEncoding)
Property Value
Type: MsoEncoding
One of the MsoEncoding values.
Remarks
This property sets text encoding separately from HTML encoding, which you can set using the Encoding property of the WebOptions object. You can get the WebOptions object from the WebOptions property. To set text encoding for all documents saved as text files, use the DefaultTextEncoding property.
Examples
The following code example sets the document encoding to Western if the document is saved as a text file.
This example is for a document-level customization.
Private Sub DocumentTextEncoding()
Me.TextEncoding = Office.MsoEncoding.msoEncodingWestern
End Sub
private void DocumentTextEncoding()
{
this.TextEncoding = Office.MsoEncoding.msoEncodingWestern;
}
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.