Font Property

An accessor property that returns an MiFont object representing the font used by the specified word. Read-only MiFont.

expression.Font

*expression   * Required. An expression that returns a Word object.

Remarks

Use the Font accessor property to return the font family and other characteristics of the the font used by the specified word.

The Font and FontId properties are not available for documents created with Microsoft Office Document Imaging 2002.

Example

The following example performs optical character recognition (OCR) on the first page of a document, and then reports the font properties of the third recognized word.

Sub TestFont()
  
  Dim miDoc As MODI.Document
  Dim miFont As MODI.miFont
  Dim strFontInfo As String
  
  ' Load an existing TIFF file.
  Set miDoc = New MODI.Document
  miDoc.Create "C:\document1.tif"
  
  ' Perform OCR.
  miDoc.Images(0).OCR
  
  ' Retrieve and display font information.
  Set miFont = miDoc.Images(0).Layout.Words(2).Font
  strFontInfo = _
    "Font family: " & miFont.Family & vbCrLf & _
    "Font size: " & miFont.FontSize & vbCrLf & _
    "Face style: " & miFont.FaceStyle & vbCrLf & _
    "Serif style: " & miFont.SerifStyle & vbCrLf
  MsgBox strFontInfo, vbInformation + vbOKOnly, _
    "Font Information"
  
  Set miFont = Nothing
  Set miDoc = Nothing

End Sub

Applies to | Word Object