The primary purpose of a Writer document is to contain simple text. The text is stored and enumerated by paragraphs. When a paragraph enumerates content, each enumerated section uses the same set of properties. In general, text content must be created by the document that will contain the content. After creation, the text content is inserted into the document at a specified location. Paragraphs, however, are not specifically created and then inserted (see Listing 3 near the beginning of this chapter). Paragraph text is inserted as a string and new paragraphs are inserted as control characters (see Table 2). More complicated text content is typically added using the insertTextContent() object method (see Listing 4). There are other, less-used methods to insert text content-for example, pasting content from the clipboard (see Listing 47 later in this chapter) and inserting an entire document (see Listing 36 ).
oCursor.insertDocumentFromURL(sFileURL, Array())
Most text content is named and accessible in a similar way (see Table 17 ). The most popular content type in Table 17 is undoubtedly text tables.
Content Type | Mechanism | Access Method |
---|---|---|
Footnotes | Index Access | getFootnotes() |
End notes | Index Access | getEndnotes() |
Reference marks | Named Access | getReferenceMarks() |
Graphic objects | Named Access | getGraphicObjects() |
Embedded objects | Named Access | getEmbeddedObjects() |
Text tables | Named Access | getTables() |
Bookmarks | Named Access | getBookmarks() |
Style families | Named Access | getStyleFamilies() |
Document indexes | Index Access | get Document Indexes() |
Text fields | Enumeration Access | getTextFields() |
Text field masters | Named Access | getTextFieldMasters() |
Text frames | Named Access | getTextFrames() |
Text sections | Named Access | getTextSections() |
Tip | Content accessible using named access also provides indexed access. |