Export (0) Print
Expand All

OptimizeForBrowser class

Defines the OptimizeForBrowser Class. When the object is serialized out as xml, its qualified name is w:optimizeForBrowser.

Namespace:  DocumentFormat.OpenXml.Wordprocessing
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)

public class OptimizeForBrowser : OnOffType

[ISO/IEC 29500-1 1st Edition]

optimizeForBrowser (Disable Features Not Supported by Target Web Profile)

This element specifies whether applications should attempt to customize the output for any web page produced from this document, as well as the HTML output to which it should be customized. [Example: This might involve blocking any output which is not supported by that target output profile. end example] The target output profile is identified by the contents of the target attribute.

[Example: Consider a document whose web settings part contains the following WordprocessingML:

<w:optimizeForBrowser w:target="W3C XHTML+1" />
<w:allowPNG w:val="on"/>
<w:relyOnVML w:val="on"/>

The optimizeForBrowser element specifies that the output should be optimized for a specific output target. Since the value of the target attribute specifies a target of W3C XHTML 1.0 output using 1, any HTML generated should fall within that profile. end example]

Parent Elements

webSettings (§



target (Target Output Profile)

Specifies the version of HTML output targeted by the output of any web page produced by this document. This attribute shall only contain a string that represents an output profile defined by published standards and W3C recommendations. Product names shall not be used to define a profile.

The following reserved values and their targets are listed below:




W3C XHTML 1.0 + 1


W3C HTML 4.01 + 1


W3C XHTML 1.0 + 2


W3C HTML 4.01 + 2

[Example: For example, consider the following web publishing settings:

<w:optimizeForBrowser w:target="W3C XHTML+2"/>

The target attribute explicitly declares that any web page generated from this document should target W3C XHTML 1.0 + 2. end example]

The possible values for this attribute are defined by the ST_String simple type (§

val (On/Off Value)

Specifies a binary value for the property defined by the parent XML element.

A value of 1 or true specifies that the property shall be explicitly applied. This is the default value for this attribute, and is implied when the parent element is present, but this attribute is omitted.

A value of 0 or false specifies that the property shall be explicitly turned off.

[Example: For example, consider the following on/off property:

<… w:val="false"/>

The val attribute explicitly declares that the property is false. end example]

The possible values for this attribute are defined by the ST_OnOff simple type (§

[Note: The W3C XML Schema definition of this element’s content model (CT_OptimizeForBrowser) is located in §A.1. end note]

© ISO/IEC29500: 2008.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

© 2014 Microsoft