Etudes for Microsoft Word Programmers. Appendix.


Information on this page is from Microsoft MSDN http://msdn.microsoft.com.

Font (Word 2003)

Font in printing, sometimes called Fount, a complete set of type of any one size, with all the usual points and accents; a font consists of about 100,000 characters.

http://www.websters-online-dictionary.org/definition/Font

Font Object

Font is a complete set of symbols (as a rule for some language) with unique design. Font family is called typeface. The most popular typefaces are Times and Courier. Symbols are saved as bitmaps in bitmap (or raster) fonts, and are saved as a set of objects in vector fonts. The font has a set of attributes: font weight, font size etc.

Font Object Properties

Font object properties are described in the following table.

Property

Type

Description

AllCaps

Read/write
Long

True if the font is formatted as all capital letters. Returns True, False, or wdUndefined  (a mixture of True and False). Can be set to True, False, or wdToggle (reverses the current setting).
Setting AllCaps to True sets SmallCaps to False, and vice versa.

Animation

Read/write WdAnimation

Returns or sets the type of animation applied to the font.

Bold

Read/write
Long

True if the font or range is formatted as bold. Returns True, False or wdUndefined (a mixture of True and False).
Can be set to True, False, or wdToggle.

Borders

Borders
Collection

Returns a Borders collection that represents all the borders for the specified object.

Color

WdColor Constant

Returns or sets the 24-bit color for the specified Border or Font object. Can be any valid WdColor constant or a value returned by Visual Basic's RGB function.

ColorIndex

Read/write WdColorIndex

Returns or sets the color for the specified border or font object.

DisableCharacter
SpaceGrid

Read/write Boolean

True if Microsoft Word ignores the number of characters per line for the corresponding Font or Range object. Returns wdUndefined if the DisableCharacterSpaceGrid property is set to True for only some of the specified font or range.

DoubleStrikeThrough

Read/write
Long

True if the specified font is formatted as double strikethrough text. Returns True, False, or wdUndefined (a mixture of True and False). Can be set to True, False, or wdToggle.

Note  To set or return single-line strikethrough formatting, use the StrikeThrough property. Setting DoubleStrikeThrough to True sets StrikeThrough to False, and vice versa.

Duplicate

Font Object
Read-only

Returns a read-only Font object that represents the character formatting of the specified font.

You can use the Duplicate property to pick up the settings of all the properties of a duplicated Font, LetterContent, or ParagraphFormat object. You can assign the object returned by the Duplicate property to another object of the same type to apply those settings all at once. Before assigning the duplicate object to another object, you can change any of the properties of the duplicate object without affecting the original.

By duplicating a Range object, you can change the starting or ending character position of the duplicate range without changing the original range.

Emboss

Read/write
Long

True if the specified font is formatted as embossed. Returns True, False, or wdUndefined. Can be set to True, False, or wdToggle.

Setting Emboss to True sets Engrave to False, and vice versa.

EmphasisMark

Read/write WdEmphasisMark

Returns or sets the emphasis mark for a character or designated character string.

Engrave

Read/write
Long

True if the font is formatted as engraved. Returns True, False or wdUndefined (a mixture of True and False). Can be set to True, False, or wdToggle.

Setting Engrave to True sets Emboss to False, and vice versa.

Hidden

Read/write
Long

True if the font is formatted as hidden text. Returns True, False or wdUndefined (a mixture of True and False). Can be set to True, False, or wdToggle.

To control the display of hidden text, use the ShowHiddenText property of the View object.

To control whether properties and methods that return Range objects include or exclude hidden text when hidden text isn't displayed, use the IncludeHiddenText property of the TextRetrievalMode object.

Italic

Read/write
Long

True if the font or range is formatted as italic. Returns True, False or wdUndefined (a mixture of True and False).
Can be set to True, False, or wdToggle.

Kerning

Read/write
Single

Returns or sets the minimum font size for which Microsoft Word will adjust kerning automatically.

Name

Read/write
String

Returns or sets the name of the specified object.

NameAscii

Read/write
String

Returns or sets the font used for Latin text (characters with character codes from 0 (zero) through 127).

In the U.S. English version of Microsoft Word, the default value of this property is Times New Roman. Use the Name property to change the font that's applied to all text and that appears in the Font box on the Formatting toolbar.

Outline

Read/write
Long

True if the font is formatted as outline. Returns True, False, or wdUndefined (a mixture of True and False).
Can be set to True, False, or wdToggle.

Position

Read/write
Long

Returns or sets the position of text (in points) relative to the base line. A positive number raises the text, and a negative number lowers it.

Scaling

Read/write
Long

Returns or sets the scaling percentage applied to the font. This property stretches or compresses text horizontally as a percentage of the current size (the scaling range is from 1 through 600).

Shading

Shading object

Returns a Shading object that refers to the shading formatting for the specified object.

Shadow

Read/write
Long

True if the specified font is formatted as shadowed. Can be True, False, or wdUndefined.

Size

Read/write
Single

Returns or sets the font size in points.

SmallCaps

Read/write
Long

True if the font is formatted as small capital letters. Returns True, False or wdUndefined (a mixture of True and False). Can be set to True, False, or wdToggle.

Setting the SmallCaps property to True sets the AllCaps property to False, and vice versa.

Spacing

Read/write
Single

Returns or sets the spacing between characters in points.

StrikeThrough

Read/write
Long

True if the font is formatted as strikethrough text. Returns True, False or wdUndefined (a mixture of True and False). Can be set to True, False, or wdToggle.

To set or return double strikethrough formatting, use the DoubleStrikeThrough property.

Subscript

Read/write
Long

True if the font is formatted as subscript. Returns True, False or wdUndefined (a mixture of True and False).
Can be set to True, False, or wdToggle.

Setting the Subscript property to True sets the Superscript property to False, and vice versa.

Superscript

Read/write
Long

True if the font is formatted as superscript. Returns True, False, or wdUndefined (a mixture of True and False). Can be set to True, False, or wdToggle.

Setting the Superscript property to True sets the Subscript property to False, and vice versa.

Underline

Read/write WdUnderline

Returns or sets the type of underline applied to the font or range.

UnderlineColor

WdColor Constant

Returns or sets the 24-bit color of the underline for the specified Font object. Can be any valid WdColor constant or a value returned by Visual Basic's RGB function.

Setting the UnderlineColor property to wdColorAutomatic resets the color of the underline to the color of the text above it.

The following picture illustrates formatting samples for some font attributes.

Enumeration WdAnimation

Enumeration WdAnimation defines animation type.

Constant Value Constant Value
wdAnimationBlinkingBackground 2 wdAnimationNone 0
wdAnimationLasVegasLights 1 wdAnimationShimmer 6
wdAnimationMarchingBlackAnts 4 wdAnimationSparkleText 3
wdAnimationMarchingRedAnts 5    

Enumeration WdUnderline

Enumeration WdUnderline defines underline type.

Constant Value Constant Value
wdUnderlineDash 7 wdUnderlineDottedHeavy 20
wdUnderlineDashHeavy 23 wdUnderlineDouble 3
wdUnderlineDashLong 39 wdUnderlineNone 0
wdUnderlineDashLongHeavy 55 wdUnderlineSingle 1

Enumeration WdEmphasisMark

Enumeration WdEmphasisMark defines emphasis type.

Constant Value
wdEmphasisMarkNone 0
wdEmphasisMarkOverComma 2
wdEmphasisMarkOverSolidCircle 1
wdEmphasisMarkOverWhiteCircle 3
wdEmphasisMarkUnderSolidCircle 4

Font Object Methods

Font object methods are described in the following table.

Method

Description

Grow

Increases the font size to the next available size. If the selection or range contains more than one font size, each size is increased to the next available setting.

Reset

Removes manual character formatting (formatting not applied using a style). For example, if you manually format a word as bold and the underlying style is plain text (not bold), the Reset method removes the bold format.

SetAsTemplateDefault

Sets the specified font formatting as the default for the active document and all new documents based on the active template. The default font formatting is stored in the Normal style.

Shrink

Decreases the font size to the next available size. If the selection or range contains more than one font size, each size is decreased to the next available setting.

 


Etudes for Microsoft Word Programmers. Appendix. Object Font.


Unless otherwise noted, all materials on this site are
2000-2009 Evgeny Akhundzhanov, All Rights Reserved Worldwide
Microsoft is in no way affiliated with, nor offers endorsement of, this site.
www.transcriber.ru | E-mail the Author