Description
Fills the geometry of the current text with the specified string, or with the default string ("Gallia est omnis divisa in partes tres...") if the specified string is empty.
The specified string is split in multiple paragraphs if it contains end of line (CR, LF characters sequence). The string is appended multiple times to any existing text until the geometry is filled. Appropriate paragraph styles are inserted according to what specified in the schema and in the text format.
Note: this works on unlinked text only if there's at least one justification area available.
Syntax
Text.InsDummyText (str1) |
str1
Text to insert
Return value
Error code
See also
Context
Text designer commands
Examples
1. Insert default string ("Gallia est omnis divisa in partes tres...") in whole text, from the position of the cursor. If there was some text already, the dummy text starts in the new paragraph.
Text.insdummytext ("")
2. The function InsertDummyText fills the text with the "Lorem ipsum" text. The function RemoveDummyText removes the "Lorem ipsum" from the text, except in the last, stripped part - you will have to remove it manually.
Function InsertDummyText
dim e = Page.txtedit (False, True)
If e = EOK Then
dim strLoremIpsum = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." & vbcrlf & vbcrlf
Text.insdummytext (strLoremIpsum)
End If
Text.winclose
End Function
Function RemoveDummyText
dim e = Page.txtedit (False, True)
If e = EOK Then
Text.CursorStartText
Text.EditBlockStart
Text.CursorEndText
Text.EditBlockEnd
dim strLoremIpsum = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." & vbcrlf & vbcrlf
dim strAllText = Text.GetTxt
strAllText = Replace(strAllText, strLoremIpsum, "")
Text.instedtext (strAllText)
End If
Text.winclose
End Function