DocumentBase.OpenEncoding 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取用于打开文档的编码。
public Microsoft.Office.Core.MsoEncoding OpenEncoding { get; }
属性值
MsoEncoding 值之一。
示例
下面的代码示例将检查该文档是否为 UTF7 编码的文档,并显示一条显示结果的消息。 若要使用此示例,请在 ThisDocument 文档级项目的类中运行它。
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!");
}
}
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