Class DefaultWebOptions (Word VBA)

Contains global application-level attributes used by Microsoft Word when you open a webpage or save a document as a webpage.

Set

To use a DefaultWebOptions class variable it first needs to be instantiated, for example

Dim dwos as DefaultWebOptions
Set dwos = Application.DefaultWebOptions()

DefaultWebOptions class variables can be set using the Application.DefaultWebOptions procedure.

Properties

AllowPNG false if PNG (Portable Network Graphics) is not allowed as an output format.

Application.DefaultWebOptions.AllowPNG = True

AlwaysSaveInDefaultEncoding true if the default encoding is used when you save a webpage or plain text document, independent of the file's original encoding when opened.

Application.DefaultWebOptions.AlwaysSaveInDefaultEncoding = True

BrowserLevel returns or sets a WdBrowserLevel constant that represents the level of the web browser for which you want to target new Web pages created in Microsoft Word.

Application.DefaultWebOptions.BrowserLevel = wdBrowserLevelMicrosoftInternetExplorer5

CheckIfOfficeIsHTMLEditor true if Microsoft Word checks to see whether an Office application is the default HTML editor when you start Word.

Application.DefaultWebOptions.CheckIfOfficeIsHTMLEditor = True

CheckIfWordIsDefaultHTMLEditor true if Microsoft Word checks to see whether it is the default HTML editor when you start Word.

Application.DefaultWebOptions.CheckIfWordIsDefaultHTMLEditor = True

Encoding returns or sets the document encoding (code page or character set) to be used by the web browser when you view the saved document.

Application.DefaultWebOptions.Encoding =

FolderSuffix returns a String that represents the folder suffix that Microsoft Word uses when you save a document as a webpage, use long file names, or save supporting files in a separate folder.

Dim strFolderSuffix As String
strFolderSuffix = Application.DefaultWebOptions.FolderSuffix

Fonts returns the WebPageFonts collection representing the set of fonts that Microsoft Word uses when you open a webpage in Word.

Dim wpfsFonts As Office.WebPageFonts
Set wpfsFonts = Application.DefaultWebOptions.Fonts

OptimizeForBrowser true if Microsoft Word optimizes new Web pages created in Word for the web browser specified by the BrowserLevel property.

Application.DefaultWebOptions.OptimizeForBrowser = True

OrganizeInFolder true if all supporting files, such as background textures and graphics, are organized in a separate folder when you save the specified document as a webpage. False if supporting files are saved in the same folder as the webpage. The default value is True.

Application.DefaultWebOptions.OrganizeInFolder = True

Parent returns an object that represents the parent object of the specified DefaultWebOptions object.

Dim objParent As Object
Set objParent = Application.DefaultWebOptions.Parent

PixelsPerInch returns or sets the density (pixels per inch) of graphics images and table cells on a webpage.

Application.DefaultWebOptions.PixelsPerInch =

RelyOnCSS true if cascading style sheets (CSS) are used for font formatting when you view a saved document in a web browser.

Application.DefaultWebOptions.RelyOnCSS = True

RelyOnVML true if image files are not generated from drawing objects when you save a document as a webpage. False if images are generated. The default value is False.

Application.DefaultWebOptions.RelyOnVML = True

SaveNewWebPagesAsWebArchives true for Microsoft Word to save new Web pages in the Single File Web Page (formerly known as Web Archive) format.

Application.DefaultWebOptions.SaveNewWebPagesAsWebArchives = True

ScreenSize returns or sets the ideal minimum screen size (width by height, in pixels) that you should use when viewing the saved document in a web browser.

Application.DefaultWebOptions.ScreenSize =

TargetBrowser sets or returns an MsoTargetBrowser constant representing the target browser for documents viewed in a web browser.

Application.DefaultWebOptions.TargetBrowser =

UpdateLinksOnSave true if hyperlinks and paths to all supporting files are automatically updated before you save the document as a webpage.

Application.DefaultWebOptions.UpdateLinksOnSave = True

UseLongFileNames true if long file names are used when you save the document as a webpage. False if long file names are not used and the DOS file name format (8.3) is used. The default value is True.

Application.DefaultWebOptions.UseLongFileNames = True