# Document Editor

> Build a VB6 word processor with TXTextControl: files, formatting, styles, sections, tables, images, fields, track changes, protection, XML and printing.

- **Product:** TX Text Control ActiveX
- **Section:** Documentation
- **Kind:** Topic
- **Path:** TX Text Control ActiveX > Document Editor
- **1960 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-activex/document-editor/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-activex/document-editor/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-activex/document-editor/llms-full.txt

---

A form with a `TXTextControl` on it is a word processor: users type, format text, insert tables and images and print, while your code loads and saves documents, reacts to events and adds commands of its own. The pages below cover each of these subjects, from the view modes and file formats to formatting, tables, fields, reviewing, protection, XML documents and printing.

If you haven't placed a `TXTextControl` on a form yet, start with [Creating a Simple Word Processor](https://docs.textcontrol.com/tx-text-control-activex/getting-started/first-application/llms-full.txt). It creates the Visual Basic project, connects the button bar, the ruler bars and the status bar to the control and adds the menus that the tutorials here build on.

### How the Editor Works

- **One control holds the document.** [TXTextControl](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/llms-full.txt) displays and edits a text document. Its view mode decides whether the user sees pages, a continuous text or a plain text box.
- **The bars are separate controls.** [TXButtonBar](https://docs.textcontrol.com/tx-text-control-activex/reference/txbuttonbar/llms-full.txt), [TXRulerBar](https://docs.textcontrol.com/tx-text-control-activex/reference/txrulerbar/llms-full.txt) and [TXStatusBar](https://docs.textcontrol.com/tx-text-control-activex/reference/txstatusbar/llms-full.txt) are controls of their own that you connect to the `TXTextControl`.
- **Built-in dialog boxes need one call.** Methods such as `FontDialog`, `ParagraphDialog`, `TableAttrDialog` and `ObjectAttrDialog` open the dialog boxes of TX Text Control. [Built-in Dialog Boxes](https://docs.textcontrol.com/tx-text-control-activex/document-editor/dialog-boxes/llms-full.txt) shows each of them, and the [dialog box category](https://docs.textcontrol.com/tx-text-control-activex/reference/categories/dialog-boxes/llms-full.txt) of the reference lists their methods.
- **Most pages come with a sample.** The Visual Basic tutorials explain sample programs whose source code is installed below *Samples\\vb6*, and the technical articles explain how the properties, methods and events of one subject work together.

### Find the Right Page

| If you want to | Read |
|---|---|
| Choose between page view, normal view and the other view modes | [Text Formatting and Views](https://docs.textcontrol.com/tx-text-control-activex/document-editor/viewing/llms-full.txt) |
| Load and save RTF, HTML, DOC, DOCX and other formats | [Working with Files](https://docs.textcontrol.com/tx-text-control-activex/document-editor/load-save/llms-full.txt) |
| Load or insert files that users drop on the control | [File Drag and Drop](https://docs.textcontrol.com/tx-text-control-activex/document-editor/drag-drop/llms-full.txt) |
| Read and write the title, author and keywords of a document | [Document Properties](https://docs.textcontrol.com/tx-text-control-activex/document-editor/properties/llms-full.txt) |
| Add page setup, print, search and color dialog boxes | [A Word Processor](https://docs.textcontrol.com/tx-text-control-activex/document-editor/word-processor/llms-full.txt) |
| Insert tables, calculate cells with formulas and format numbers | [Tables](https://docs.textcontrol.com/tx-text-control-activex/document-editor/tables/llms-full.txt) |
| Place images and text frames in a document | [Using Images](https://docs.textcontrol.com/tx-text-control-activex/document-editor/images/llms-full.txt), [Using Text Frames](https://docs.textcontrol.com/tx-text-control-activex/document-editor/text-frames/llms-full.txt) |
| Add headers and footers | [Headers and Footers](https://docs.textcontrol.com/tx-text-control-activex/document-editor/headers-footers/llms-full.txt) |
| Mark text with fields, hypertext links, bookmarks or Word fields | [Marked Text Fields](https://docs.textcontrol.com/tx-text-control-activex/document-editor/fields/llms-full.txt) |
| Open, edit and program XML documents | [Working with XML Files](https://docs.textcontrol.com/tx-text-control-activex/document-editor/xml/llms-full.txt) |
| Print, print page by page or show a print preview | [Printing](https://docs.textcontrol.com/tx-text-control-activex/document-editor/printing/llms-full.txt) |
| Format characters and paragraphs, set tabs and paragraph frames | [Character and Paragraph Formatting](https://docs.textcontrol.com/tx-text-control-activex/document-editor/formatting/llms-full.txt) |
| Create, change and apply formatting styles | [Stylesheets](https://docs.textcontrol.com/tx-text-control-activex/document-editor/stylesheets/llms-full.txt) |
| Add bulleted, numbered and structured lists | [Bulleted and Numbered Lists](https://docs.textcontrol.com/tx-text-control-activex/document-editor/lists/llms-full.txt) |
| Divide a document into sections, set page size, margins, columns and page borders | [Sections and Page Setup](https://docs.textcontrol.com/tx-text-control-activex/document-editor/sections/llms-full.txt) |
| Insert and number footnotes | [Footnotes](https://docs.textcontrol.com/tx-text-control-activex/document-editor/footnotes/llms-full.txt) |
| Generate and update a table of contents | [Tables of Contents](https://docs.textcontrol.com/tx-text-control-activex/document-editor/tables-of-contents/llms-full.txt) |
| Build forms with text, check box, drop-down and date fields | [Form Fields](https://docs.textcontrol.com/tx-text-control-activex/document-editor/form-fields/llms-full.txt), [Signature Fields](https://docs.textcontrol.com/tx-text-control-activex/document-editor/signature-fields/llms-full.txt) |
| Track, review, accept and reject changes, or comment on text | [Track Changes](https://docs.textcontrol.com/tx-text-control-activex/document-editor/track-changes/llms-full.txt), [Comments](https://docs.textcontrol.com/tx-text-control-activex/document-editor/comments/llms-full.txt) |
| Protect a document and mark editable regions for users | [Document Protection](https://docs.textcontrol.com/tx-text-control-activex/document-editor/protection/llms-full.txt) |
| Underline misspelled words and offer corrections | [Spell Checking](https://docs.textcontrol.com/tx-text-control-activex/document-editor/spell-checking/llms-full.txt) |
| Select text, use the clipboard, undo and redo | [Selections, Clipboard and Undo](https://docs.textcontrol.com/tx-text-control-activex/document-editor/editing/llms-full.txt) |
| Connect the button bar, rulers and status bar | [Button Bar, Ruler Bar and Status Bar](https://docs.textcontrol.com/tx-text-control-activex/document-editor/toolbars/llms-full.txt) |
| Open the dialog boxes built into TXTextControl | [Built-in Dialog Boxes](https://docs.textcontrol.com/tx-text-control-activex/document-editor/dialog-boxes/llms-full.txt) |

### Where to Start

1. Work through [Creating a Simple Word Processor](https://docs.textcontrol.com/tx-text-control-activex/getting-started/first-application/llms-full.txt).
2. Read [Text Formatting and Views](https://docs.textcontrol.com/tx-text-control-activex/document-editor/viewing/llms-full.txt) for the view modes and the twips that TX Text Control measures in.
3. Continue with [A Word Processor](https://docs.textcontrol.com/tx-text-control-activex/document-editor/word-processor/llms-full.txt), which adds the dialog boxes of a complete word processor.
4. Open the page of the feature you are adding.

### Pages in This Section

- [Text Formatting and Views](https://docs.textcontrol.com/tx-text-control-activex/document-editor/viewing/llms-full.txt): twips, view modes and page sizes.
- [Working with Files](https://docs.textcontrol.com/tx-text-control-activex/document-editor/load-save/llms-full.txt): file formats, loading and saving.
- [File Drag and Drop](https://docs.textcontrol.com/tx-text-control-activex/document-editor/drag-drop/llms-full.txt): files dropped on the control.
- [Document Properties](https://docs.textcontrol.com/tx-text-control-activex/document-editor/properties/llms-full.txt): title, subject, author and keywords.
- [A Word Processor](https://docs.textcontrol.com/tx-text-control-activex/document-editor/word-processor/llms-full.txt): dialog boxes, search and paragraph frames.
- [Tables](https://docs.textcontrol.com/tx-text-control-activex/document-editor/tables/llms-full.txt): table identifiers, formulas and number formats.
- [Using Images](https://docs.textcontrol.com/tx-text-control-activex/document-editor/images/llms-full.txt): inserting images and setting their attributes.
- [Using Text Frames](https://docs.textcontrol.com/tx-text-control-activex/document-editor/text-frames/llms-full.txt): text frames and printed labels.
- [Headers and Footers](https://docs.textcontrol.com/tx-text-control-activex/document-editor/headers-footers/llms-full.txt): headers, footers and their activation.
- [Marked Text Fields](https://docs.textcontrol.com/tx-text-control-activex/document-editor/fields/llms-full.txt): fields, hypertext links, bookmarks and Word fields.
- [Working with XML Files](https://docs.textcontrol.com/tx-text-control-activex/document-editor/xml/llms-full.txt): XML documents with CSS and DTD.
- [Printing](https://docs.textcontrol.com/tx-text-control-activex/document-editor/printing/llms-full.txt): printing, paper bins and print preview.
- [Character and Paragraph Formatting](https://docs.textcontrol.com/tx-text-control-activex/document-editor/formatting/llms-full.txt): fonts, attributes, alignment, indents, tabs and frames.
- [Stylesheets](https://docs.textcontrol.com/tx-text-control-activex/document-editor/stylesheets/llms-full.txt): paragraph and character styles.
- [Bulleted and Numbered Lists](https://docs.textcontrol.com/tx-text-control-activex/document-editor/lists/llms-full.txt): list types, levels and number formats.
- [Sections and Page Setup](https://docs.textcontrol.com/tx-text-control-activex/document-editor/sections/llms-full.txt): sections, page size, margins, columns and page borders.
- [Footnotes](https://docs.textcontrol.com/tx-text-control-activex/document-editor/footnotes/llms-full.txt): inserting, numbering and listing footnotes.
- [Tables of Contents](https://docs.textcontrol.com/tx-text-control-activex/document-editor/tables-of-contents/llms-full.txt): generating and updating a table of contents.
- [Form Fields](https://docs.textcontrol.com/tx-text-control-activex/document-editor/form-fields/llms-full.txt): text, check box, combo box, drop-down and date fields.
- [Signature Fields](https://docs.textcontrol.com/tx-text-control-activex/document-editor/signature-fields/llms-full.txt): signature fields and their signer data.
- [Track Changes](https://docs.textcontrol.com/tx-text-control-activex/document-editor/track-changes/llms-full.txt): tracking, reviewing, accepting and rejecting changes.
- [Comments](https://docs.textcontrol.com/tx-text-control-activex/document-editor/comments/llms-full.txt): comments, replies and their highlighting.
- [Document Protection](https://docs.textcontrol.com/tx-text-control-activex/document-editor/protection/llms-full.txt): permissions, protection and editable regions.
- [Spell Checking](https://docs.textcontrol.com/tx-text-control-activex/document-editor/spell-checking/llms-full.txt): the SpellCheckText event and TX Spell .NET.
- [Selections, Clipboard and Undo](https://docs.textcontrol.com/tx-text-control-activex/document-editor/editing/llms-full.txt): selections, the clipboard, undo, search and the keyboard.
- [Button Bar, Ruler Bar and Status Bar](https://docs.textcontrol.com/tx-text-control-activex/document-editor/toolbars/llms-full.txt): the three bars and how they connect.
- [Built-in Dialog Boxes](https://docs.textcontrol.com/tx-text-control-activex/document-editor/dialog-boxes/llms-full.txt): the dialog boxes TXTextControl opens itself.

---

## In This Section

- [Comments](https://docs.textcontrol.com/tx-text-control-activex/document-editor/comments/llms-full.txt): Insert, edit, reply to and delete comments in a TXTextControl document with VB6, list them in a window and choose how commented text is highlighted.
- [Built-In Dialog Boxes](https://docs.textcontrol.com/tx-text-control-activex/document-editor/dialog-boxes/llms-full.txt): Open the dialog boxes built into TXTextControl from VB6: Font, Paragraph, Tabs, lists, styles, page setup, tables, images, form fields and find and replace.
- [File Drag and Drop](https://docs.textcontrol.com/tx-text-control-activex/document-editor/drag-drop/llms-full.txt): Handle WM_DROPFILES by subclassing: load or insert dropped files at the drop point with InputPosFromPoint and Load, and insert images with ObjectInsertAsChar.
- [Selections, Clipboard and Undo](https://docs.textcontrol.com/tx-text-control-activex/document-editor/editing/llms-full.txt): Select text and move the input position in VB6, run cut, copy and paste, undo and redo edits, group undo steps, search text and switch overwrite mode.
- [Marked Text Fields](https://docs.textcontrol.com/tx-text-control-activex/document-editor/fields/llms-full.txt): Insert, find, change, protect and delete marked text fields in TXTextControl with FieldInsert, FieldCurrent, FieldText and FieldNext, and handle field events.
- [Footnotes](https://docs.textcontrol.com/tx-text-control-activex/document-editor/footnotes/llms-full.txt): Insert, edit, number, find and delete footnotes in a TXTextControl document with VB6: FootnoteInsert, number formats, highlighting and footnote lists.
- [Form Fields](https://docs.textcontrol.com/tx-text-control-activex/document-editor/form-fields/llms-full.txt): Insert text, check box, combo box, drop-down and date form fields in VB6, open FormFieldDialog, read what users entered and protect the rest of the form.
- [Character and Paragraph Formatting](https://docs.textcontrol.com/tx-text-control-activex/document-editor/formatting/llms-full.txt): Format text in VB6 with TXTextControl: fonts, bold, colors, alignment, indents, line spacing, tabs and paragraph frames, plus the Font and Paragraph dialogs.
- [Headers and Footers](https://docs.textcontrol.com/tx-text-control-activex/document-editor/headers-footers/llms-full.txt): Add, activate and remove headers and footers with HeaderFooter, HeaderFooterActivate and HeaderFooterStyle, and change their text with HeaderFooterSelect.
- [Using Images](https://docs.textcontrol.com/tx-text-control-activex/document-editor/images/llms-full.txt): Insert images anchored, as a character or fixed with ImageInsert, embed or link image data, and open the Image Attributes dialog with ObjectAttrDialog in VB6.
- [Bulleted and Numbered Lists](https://docs.textcontrol.com/tx-text-control-activex/document-editor/lists/llms-full.txt): Create bulleted, numbered and structured lists in VB6 with ListType, BulletAttribute and NumberingAttribute, change list levels and open ListAttrDialog.
- [Working With Files](https://docs.textcontrol.com/tx-text-control-activex/document-editor/load-save/llms-full.txt): Load and save RTF, HTML, XML, DOCX, DOC, text and the native format with TXTextControl, export PDF, and write file headers or several controls to one file.
- [Printing](https://docs.textcontrol.com/tx-text-control-activex/document-editor/printing/llms-full.txt): Print with PrintDoc or page by page with PrintPage and PrintDevice, switch paper bins for letterhead and preview pages in a Picture Box with PrintZoom.
- [Document Properties](https://docs.textcontrol.com/tx-text-control-activex/document-editor/properties/llms-full.txt): Set and read title, subject, author, keywords and creation and modification dates of RTF, DOC and DOCX documents with the LoadSaveAttribute property.
- [Document Protection](https://docs.textcontrol.com/tx-text-control-activex/document-editor/protection/llms-full.txt): Protect documents with EditMode and a password in VB6, set document permissions, mark editable regions for users and check what the user may change.
- [Sections and Page Setup](https://docs.textcontrol.com/tx-text-control-activex/document-editor/sections/llms-full.txt): Insert section breaks and set page size, margins, orientation, columns, page borders and page numbering per section in VB6, with SectionFormatDialog.
- [Signature Fields](https://docs.textcontrol.com/tx-text-control-activex/document-editor/signature-fields/llms-full.txt): Insert signature fields with SignatureFieldInsert in VB6, store the suggested signer, add a signature image and sign the fields when saving as PDF.
- [Spell Checking](https://docs.textcontrol.com/tx-text-control-activex/document-editor/spell-checking/llms-full.txt): Underline misspelled words in VB6 with the SpellCheckText event, check them with TX Spell .NET and correct them from a context menu or spelling dialog.
- [Stylesheets](https://docs.textcontrol.com/tx-text-control-activex/document-editor/stylesheets/llms-full.txt): Create, apply and change paragraph and character styles in VB6 with the Style object, the Styles collection and StyleDialog, and react to style changes.
- [Tables of Contents](https://docs.textcontrol.com/tx-text-control-activex/document-editor/tables-of-contents/llms-full.txt): Generate a table of contents from structure levels with TableOfContentsDialog, then update, change and delete it in VB6 as the TXWords sample does.
- [Tables](https://docs.textcontrol.com/tx-text-control-activex/document-editor/tables/llms-full.txt): Insert tables with TableInsert or Load from RTF and HTML, select and delete rows, open TableAttrDialog, check TableCanInsert and resize cells with the ruler.
- [Using Text Frames](https://docs.textcontrol.com/tx-text-control-activex/document-editor/text-frames/llms-full.txt): Insert text frames with TextFrameInsert, open their settings with ObjectAttrDialog and fill labels with ObjectNext and TextFrameSelect in Visual Basic 6.
- [Button Bar, Ruler Bar and Status Bar](https://docs.textcontrol.com/tx-text-control-activex/document-editor/toolbars/llms-full.txt): Connect TXButtonBar, TXRulerBar and TXStatusBar to TXTextControl in VB6, arrange buttons and status fields, set up both rulers and show or hide the bars.
- [Track Changes](https://docs.textcontrol.com/tx-text-control-activex/document-editor/track-changes/llms-full.txt): Turn on track changes in VB6, list tracked insertions and deletions, accept or reject them and build a review dialog box like the TXWords sample's.
- [Text Formatting and Views](https://docs.textcontrol.com/tx-text-control-activex/document-editor/viewing/llms-full.txt): Set ViewMode to normal, page, floating text or simple control view, size pages in twips with PageWidth and margins, and handle scrolling and AutoExpand events.
- [A Word Processor](https://docs.textcontrol.com/tx-text-control-activex/document-editor/word-processor/llms-full.txt): TXWords, the VB6 word processor sample, sets up pages with SectionFormatDialog, prints with PrintDialog, previews pages, finds text and sets frames and colors.
- [Working With XML Files](https://docs.textcontrol.com/tx-text-control-activex/document-editor/xml/llms-full.txt): Open, validate, edit and program XML documents in TXTextControl with a CSS style sheet and a DTD: XML editor mode, XMLElements and the XML Basics sample.

---

## Nearby

- **Previous:** [Creating a Simple Word Processor](https://docs.textcontrol.com/tx-text-control-activex/getting-started/first-application/llms-full.txt)
- **Next:** [Text Formatting and Views](https://docs.textcontrol.com/tx-text-control-activex/document-editor/viewing/llms-full.txt)
