Поделиться через


WebSettings Class

Web Page Settings. It is the root element of WebSettingsPart.When the object is serialized out as xml, its qualified name is w:webSettings.

Inheritance Hierarchy

System.Object
  DocumentFormat.OpenXml.OpenXmlElement
    DocumentFormat.OpenXml.OpenXmlCompositeElement
      DocumentFormat.OpenXml.OpenXmlPartRootElement
        DocumentFormat.OpenXml.Wordprocessing.WebSettings

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

Syntax

'Declaration
<ChildElementInfoAttribute(GetType(Frameset))> _
<ChildElementInfoAttribute(GetType(Divs))> _
<ChildElementInfoAttribute(GetType(WebPageEncoding))> _
<ChildElementInfoAttribute(GetType(OptimizeForBrowser))> _
<ChildElementInfoAttribute(GetType(RelyOnVML))> _
<ChildElementInfoAttribute(GetType(AllowPNG))> _
<ChildElementInfoAttribute(GetType(DoNotRelyOnCSS))> _
<ChildElementInfoAttribute(GetType(DoNotSaveAsSingleFile))> _
<ChildElementInfoAttribute(GetType(DoNotOrganizeInFolder))> _
<ChildElementInfoAttribute(GetType(DoNotUseLongFileNames))> _
<ChildElementInfoAttribute(GetType(PixelsPerInch))> _
<ChildElementInfoAttribute(GetType(TargetScreenSize))> _
<ChildElementInfoAttribute(GetType(SaveSmartTagAsXml))> _
Public Class WebSettings _
    Inherits OpenXmlPartRootElement
'Usage
Dim instance As WebSettings
[ChildElementInfoAttribute(typeof(Frameset))]
[ChildElementInfoAttribute(typeof(Divs))]
[ChildElementInfoAttribute(typeof(WebPageEncoding))]
[ChildElementInfoAttribute(typeof(OptimizeForBrowser))]
[ChildElementInfoAttribute(typeof(RelyOnVML))]
[ChildElementInfoAttribute(typeof(AllowPNG))]
[ChildElementInfoAttribute(typeof(DoNotRelyOnCSS))]
[ChildElementInfoAttribute(typeof(DoNotSaveAsSingleFile))]
[ChildElementInfoAttribute(typeof(DoNotOrganizeInFolder))]
[ChildElementInfoAttribute(typeof(DoNotUseLongFileNames))]
[ChildElementInfoAttribute(typeof(PixelsPerInch))]
[ChildElementInfoAttribute(typeof(TargetScreenSize))]
[ChildElementInfoAttribute(typeof(SaveSmartTagAsXml))]
public class WebSettings : OpenXmlPartRootElement

Remarks

The following table lists the possible child types:

  • Frameset <w:frameset>

  • Divs <w:divs>

  • WebPageEncoding <w:encoding>

  • OptimizeForBrowser <w:optimizeForBrowser>

  • RelyOnVML <w:relyOnVML>

  • AllowPNG <w:allowPNG>

  • DoNotRelyOnCSS <w:doNotRelyOnCSS>

  • DoNotSaveAsSingleFile <w:doNotSaveAsSingleFile>

  • DoNotOrganizeInFolder <w:doNotOrganizeInFolder>

  • DoNotUseLongFileNames <w:doNotUseLongFileNames>

  • PixelsPerInch <w:pixelsPerInch>

  • TargetScreenSize <w:targetScreenSz>

  • SaveSmartTagAsXml <w:saveSmartTagsAsXml>

[ISO/IEC 29500-1 1st Edition]

17.15.2.46 webSettings (Web Page Settings)

This element specifies the set of web page settings that have been specified for a single WordprocessingML document. This element is the root element for the Web Settings part within a WordprocessingML document.

[Example: Consider the following WordprocessingML fragment for the web page settings in a WordprocessingML document:

<w:webSettings>
…
<w:frameset>
…
</w:frameset>
<w:doNotUseLongFileNames w:val="true" />
…
</w:webSettings>

The webSettings element contains all of the web page settings for this document. In this case, the web page settings specified for this document are: a frameset defined using the frameset element (§17.15.2.19); and a setting specifying that when this file is saved as a web page, all resulting files must not exceed 8.3 characters in length using the doNotUseLongFileNames element (§17.15.2.13). end example]

Parent Elements

Root element of WordprocessingML Web Settings part

Child Elements

Subclause

allowPNG (Allow PNG as Graphic Format)

§17.15.2.1

divs (Information about HTML div Elements)

§17.15.2.8

doNotOrganizeInFolder (Do Not Place Supporting Files in Subdirectory)

§17.15.2.10

doNotRelyOnCSS (Do Not Rely on CSS for Font Face Formatting)

§17.15.2.11

doNotSaveAsSingleFile (Recommend Web Page Format over Single File Web Page Format)

§17.15.2.12

doNotUseLongFileNames (Do Not Use File Names Longer than 8.3 Characters)

§17.15.2.13

encoding (Output Encoding When Saving as Web Page)

§17.15.2.14

frameset (Root Frameset Definition)

§17.15.2.19

optimizeForBrowser (Disable Features Not Supported by Target Web Profile)

§17.15.2.33

pixelsPerInch (Pixels per Inch for Graphics/Images)

§17.15.2.34

relyOnVML (Utilize VML When Saving as Web Page)

§17.15.2.35

saveSmartTagsAsXml (Save Smart Tag Data in XML Property Bag)

§17.15.2.37

targetScreenSz (Target Screen Size for Web Page)

§17.15.2.42

[Note: The W3C XML Schema definition of this element’s content model (CT_WebSettings) 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

WebSettings Members

DocumentFormat.OpenXml.Wordprocessing Namespace