4D v18

WP Import document

Home

 
4D v18
WP Import document

WP Import document 


 

WP Import document ( filePath {; option} ) -> Function result 
Parameter Type   Description
filePath  String in Path to a 4D Write document (.4w7 or .4wt)
or a 4D Write Pro document (.4wp)
option  Longint in Import option for HTML expressions
Function result  Object in 4D Write Pro object

The WP Import document command converts an existing 4D Write Pro or 4D Write document (.4wp, .4w7 or .4wt) to a new 4D Write Pro object.

In the filePath parameter, pass the path of a document stored on disk. The following types of documents are supported:

  • former 4D Write documents (.4w7 or .4wt). For a detailed list of 4D Write features that are currently supported in 4D Write Pro objects, please refer to the Importing 4D Write documents section.
  • 4D Write Pro (.4wp) format documents. For more information about the 4D Write Pro document format, refer to .4wp document format.

You must pass a complete path, unless the document is located at the same level as the structure file, in which case you can just pass its name.

By defaut, HTML expressions inserted in legacy 4D Write documents are not imported (no 4D Write Pro support). If you pass the wk import html expressions as text constant in the option parameter, HTML expressions will be imported as raw text within ##htmlBegin## and ##htmlEnd## tags -- which will require formatting actions afterwards. For example:

##htmlBegin##<span>Imported title<b>bold</b></span>##htmlEnd##

Note: If you want to import a document stored in a 4D BLOB field, you can also consider using the WP New command.

An error is returned if the filePath parameter is invalid, or if the file is missing or the file format is not supported.

Example  

 C_OBJECT(WPDoc)
 WPDoc:=WP Import document("C:\\documents\\4DWriteDocs\\Letter.4w7")



See also 

WP New

 
PROPERTIES 

Product: 4D
Theme: 4D Write Pro Language
Number: 1318

This command can be run in preemptive processes

 
HISTORY 

Created: 4D v14 R5
Modified: 4D v15 R2

 
ARTICLE USAGE

4D Write Pro Reference ( 4D v18)