OptimizeForBrowser Class

Disable Features Not Supported by Target Web Browser.When the object is serialized out as xml, its qualified name is w:optimizeForBrowser.

Inheritance Hierarchy

System.Object
  DocumentFormat.OpenXml.OpenXmlElement
    DocumentFormat.OpenXml.OpenXmlLeafElement
      DocumentFormat.OpenXml.Wordprocessing.EmptyType
        DocumentFormat.OpenXml.Wordprocessing.OptimizeForBrowser

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

Syntax

'Declaration
Public Class OptimizeForBrowser _
    Inherits EmptyType
'Usage
Dim instance As OptimizeForBrowser
public class OptimizeForBrowser : EmptyType

Remarks

[ISO/IEC 29500-1 1st Edition]

17.15.2.33 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:webSettings>
…
<w:optimizeForBrowser w:target="W3C XHTML+CSS1" />
<w:allowPNG w:val="on"/>
<w:relyOnVML w:val="on"/>
</w:webSettings>

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 CSS 1, any HTML generated should fall within that profile. end example]

Parent Elements

webSettings (§17.15.2.46)

Attributes

Description

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:

Value

Target

W3C XHTML+CSS1

W3C XHTML 1.0 + CSS 1

W3C HTML4+CSS1

W3C HTML 4.01 + CSS 1

W3C XHTML+CSS2

W3C XHTML 1.0 + CSS 2

W3C HTML4+CSS2

W3C HTML 4.01 + CSS 2

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

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

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

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

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 (§22.9.2.7).

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

© ISO/IEC29500: 2008.

Thread Safety

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

See Also

Reference

OptimizeForBrowser Members

DocumentFormat.OpenXml.Wordprocessing Namespace