Name

defaultweboptions.Fonts

Synopsis

Returns a WebPageFonts collection that represents the fonts Excel uses when saving a web page. Changing the font name or size properties of the returned WebPageFont objects does not seem to have an effect on web pages published from Excel:

Sub WebFonts(  )
    Dim fnt As WebPageFont
    Set fnt = _
      Application.DefaultWebOptions.Fonts _
      (msoCharacterSetEnglishWesternEuropeanOtherLatinScript)
    ' Show the current settings.
    Debug.Print fnt.FixedWidthFont
    Debug.Print fnt.FixedWidthFontSize
    Debug.Print fnt.ProportionalFont
    Debug.Print fnt.ProportionalFontSize
End Sub

Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.