Table of contents
TOC
Collapse the table of content
Expand the table of content

WebOptions.Encoding Property (Publisher)

office 365 dev account|Last Updated: 8/24/2017
|
3 Contributors

Returns an MsoEncoding constant that specifies the encoding of the Web publication. Read/write.

Syntax

expression. Encoding

_expression_A variable that represents an WebOptions object.

Return Value

MsoEncoding

Remarks

If the AlwaysSaveInDefaultEncoding property is set to True on a given WebOptions object, any subsequent attempts to set the Encoding property on that object will be ignored.

Attempting to set the Encoding property to an MsoEncoding constant that is not available on the client computer results in a run-time error.

The Encoding property value can be one of the ** MsoEncoding** constants declared in the Microsoft Office type library.

Example

The following example tests whether the Web publication is currently set to be saved using default encoding. If so, the AlwaysSaveInDefaultEncoding property is set to False, and the Encoding property is used to set the encoding to Unicode (UTF-8).

Dim theWO As WebOptions 

Set theWO = Application.WebOptions 

With theWO 
 If .AlwaysSaveInDefaultEncoding = True Then 
 .AlwaysSaveInDefaultEncoding = False 
 .Encoding = msoEncodingUTF8 
 End If 
End With
© 2018 Microsoft