Text Object Model
Encyclopedia
The Text Object Model is a Microsoft Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

 API
Application programming interface
An application programming interface is a source code based specification intended to be used as an interface by software components to communicate with each other...

 that provides developers with object-based rich text manipulation interfaces. It is implemented through COM
Component Object Model
Component Object Model is a binary-interface standard for software componentry introduced by Microsoft in 1993. It is used to enable interprocess communication and dynamic object creation in a large range of programming languages...

, and can be accessed through Microsoft Word
Microsoft Word
Microsoft Word is a word processor designed by Microsoft. It was first released in 1983 under the name Multi-Tool Word for Xenix systems. Subsequent versions were later written for several other platforms including IBM PCs running DOS , the Apple Macintosh , the AT&T Unix PC , Atari ST , SCO UNIX,...

 or additionally through the RichEdit controls that normally ship with Windows.

History

When TOM was developed, it was influenced heavily by WordBasic, a macro language used within Word before VBA
Visual Basic for Applications
Visual Basic for Applications is an implementation of Microsoft's event-driven programming language Visual Basic 6 and its associated integrated development environment , which are built into most Microsoft Office applications...

 (Word 95 and previous releases). TOM has developed alongside the RichEdit technology, and has been present at least since version 2.0 of the RichEdit components. The API has been available as an option for Windows CE
Windows CE
Microsoft Windows CE is an operating system developed by Microsoft for embedded systems. Windows CE is a distinct operating system and kernel, rather than a trimmed-down version of desktop Windows...

 since the 2.5 release of RichEdit (Western Languages Only), which was at least used by Pocket Word at that time.

Technical details

To retrieve an implemented instance of ITextDocument interface
Interface (computer science)
In the field of computer science, an interface is a tool and concept that refers to a point of interaction between components, and is applicable at the level of both hardware and software...

 (the top-level document interface), the EM_GETOLEINTERFACE message may be sent via the SendMessage API to obtain a pointer to an IRichEditOle object, which also implements the ITextDocument interface. TOM may operate differently depending on the version of the RichEdit control the interface is retrieved for (RICHEDIT50W windows provide more functionality than the standard RICHEDIT20W or RICHEDIT20A controls, like proper table support).

COM Interfaces

ITextDocument
A top-level interface. Documents may be opened and saved through this interface. Some screen update control is achieved here as well. Undo/redo grouping is implemented here. Arbitrary text ranges (ITextRange) and a text range for currently selected text (ITextSelection) are provided, which are used to modify or review the document.

ITextRange
Provides editing and data-binding tools to select text within a document, that can be examined, modified, or removed. Ranges exist within paragraphs, and the paragraph a range is within is accessible through a property of this object.
ITextSelection
Provides selection information, in addition to functionality provided by the ITextRange.

ITextFont
Dual Interface with ITextPara
A mechanism for inspection and modification of rich edit font attributes, that is considerably more extensive that the standard OLE interface used to describe a font (IFontDisp, StdFont).

ITextPara
Dual Interface with ITextFont
Provides extensive information about the position, formatting outside of fonts (e.g. first line indent), behavior (e.g. widow control), and purpose of a paragraph (it could be a normal paragraph, a list, a table, etc).

See also

  • Rich Text Format
    Rich Text Format
    The Rich Text Format is a proprietary document file format with published specification developed by Microsoft Corporation since 1987 for Microsoft products and for cross-platform document interchange....

  • Component Object Model
    Component Object Model
    Component Object Model is a binary-interface standard for software componentry introduced by Microsoft in 1993. It is used to enable interprocess communication and dynamic object creation in a large range of programming languages...

     (COM)
  • Object Linking and Embedding
    Object Linking and Embedding
    Object Linking and Embedding is a technology developed by Microsoft that allows embedding and linking to documents and other objects. For developers, it brought OLE Control eXtension , a way to develop and use custom user interface elements...

    (OLE)

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK