WP Get body
WP Get body ( wpDoc ) -> Function result
Parameter | Type | Description | |
---|---|---|---|
wpDoc | Object | → | 4D Write Pro document |
Function result | Object | ← | 4D Write Pro body |
Description
The WP Get body command returns the body element of the wpDoc 4D Write Pro document.
This element can be passed to the:
- WP SELECT command to select the body of the document.
- WP Text range command to define the body as a range.
- WP SET ATTRIBUTES and WP GET ATTRIBUTES commands to handle the body's attributes.
Example
You want to copy the body of a 4D Write Pro document to another 4D Write Pro document:
var $bodySource;$rangeSource;$tempoc;$bodyTarget;$rangeTarget : Object
$bodySource:=WP Get body([TEMPLATES]WPtemplate)
$rangeSource:=WP Text range($bodySource;wk start text;wk end text)
$tempoc:=WP New($rangeSource)
$bodyTarget:=WP Get body([Docs]MyWPDoc)
$rangeTarget:=WP Text range($bodyTarget;wk start text;wk end text)
WP INSERT DOCUMENT($rangeTarget;$tempoc;wk replace)