4D v17WP Get header |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v17
WP Get header
|
WP Get header ( rangeObj ) | (wpDoc ; sectionIndex {; subSectionType} ) -> Function result | ||||||||
Parameter | Type | Description | ||||||
rangeObj | Object |
![]() |
4D Write Pro range | |||||
wpDoc | Object |
![]() |
4D Write Pro document | |||||
sectionIndex | Longint |
![]() |
Section index | |||||
subSectionType | Longint |
![]() |
Sub-section type (wk first page, wk left page, or wk right page) | |||||
Function result | Object |
![]() |
4D Write Pro header reference | |||||
The WP Get header command returns a reference to the header associated to the rangeObj range or to the specified sectionIndex of the wpDoc document.
Constant | Type | Value |
wk first page | Longint | 1 |
wk left page | Longint | 2 |
wk right page | Longint | 3 |
You want to copy the header of the first page of a 4D Write Pro document to the headers of all pages of another 4D Write Pro document:
C_OBJECT($headerSource;$rangeSource;$tempoc;$headerTarget;$rangeTarget)
$headerSource:=WP Get header([TEMPLATES]WPtemplate;1;wk first page) //get the first page header of section 1
$rangeSource:=WP Create range($headerSource;wk start text;wk end text)
$tempoc:=WP New($rangeSource)
$headerTarget:=WP Get header([Docs]MyWPDoc;1) //all pages of section 1
$rangeTarget:=WP Create range($headerTarget;wk start text;wk end text)
WP INSERT DOCUMENT($rangeTarget;$tempoc;wk replace)
Product: 4D
Theme: 4D Write Pro Language
Number:
1503
Created: 4D v16 R5
4D Write Pro Reference ( 4D v17)