Skip to main content
Version: 20 R7 BETA

WP Get style sheet

WP Get style sheet ( wpDoc ; styleSheetName ) -> Function result

ParameterTypeDescription
wpDocObject4D Write Pro document
styleSheetNameStringStyle sheet name
Function resultObjectStyle sheet object

Description

The WP Get style sheet command returns the style sheet object designated by the styleSheetName.

In wpDoc, pass the 4D Write Pro document that contains the style sheet.

The styleSheetName parameter allows you to specify the name of the style sheet to return. If the style sheet name does not exist in wpDoc, an null object is returned.

Example

To retrieve the "Main title" style sheet:

 var $styleSheet : Object
 
 $styleSheet:=WP Get style sheet(wpArea;"Main title")
 If($styleSheet=Null) // check if the style sheet exists//if not create it
    $styleSheet:=WP New style sheet(wpArea;wk type paragraph;"Main title")
 End if

See also

Accessing document contents by programming
WP DELETE STYLE SHEET
WP Get style sheets
WP IMPORT STYLE SHEETS
WP New style sheet