The Font class is used to specify formatting that should be applied to a character run. It also represents the fonts of named styles in the document.

 public sealed class Font
Public NotInheritable Class Font

There are two ways to obtain an instance of this class. The Document.CreateFont() method creates a new Font object based on the Normal style. Alternately, using NamedStyle.Font, you can create a Font object that is a copy of a particular style's font. The Font object that is returned can then be used in conjunction with methods in the Element class to create character runs, paragraphs, etc, with specific fonts.

The following example demonstrates both ways of getting a font, first by retrieving the Normal style's font from the document, second by retrieving a copy of the Heading1 style's font.


          //--- Get Normal font from Document
          WordApplication app = new WordApplication();
          Document doc = app.Create();
          Font normalFont = doc.CreateFont();

          //--- Get font from Heading1 Style
          WordApplication app = new WordApplication();
          Document doc = app.Create();
          Font heading1Font = doc.Styles[NamedStyle.BuiltIn.Heading1].Font;
        

          '--- Get Normal font from Document
          Dim app As New WordApplication()
          Dim doc As Document = app.Create()
          Dim normalFont As Font = doc.CreateFont()

          '--- Get font from Heading1 Style
          Dim app As New WordApplication()
          Dim doc As Document = app.Create()
          Dim heading1Font As Font = doc.Styles(NamedStyle.BuiltIn.Heading1).Font
        

Name

Description

Animation

Bold

Border

Caps

CharacterScaling

CharacterSpacing

DoubleStrike

Embossed

Engraved

FontName

FontSize

Hidden

Highlight

HyphenationRule

Italic

Kerning

NoProofChecking

Outlined

Shading

Shadow

SmallCaps

SuperSubScript

Strike

TextColor

Underline

UnderlineColor

VerticalPosition

Name

Description

Hyphenation

ScriptType

TextAnimation

UnderlineType