This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com

Home

 
4D v19
VP IMPORT DOCUMENT

VP IMPORT DOCUMENT 


 

VP IMPORT DOCUMENT ( vpAreaName ; filePath {; paramObj} ) 
Parameter Type   Description
vpAreaName  Text in 4D View Pro area form object name
filePath  Text in Pathname of the document
paramObj  Object in Import options

The VP IMPORT DOCUMENT command imports and displays the 4D View Pro or Microsoft Excel document designated by filePath in the 4D View Pro area vpAreaName. The imported document replaces any data already inserted in the area.

In vpAreaName, pass the name of the 4D View Pro area. If you pass a name that does not exist, an error is returned.

In filePath, pass the path and name of the document to be imported. 4D View Pro documents (extension ".4vp") and Microsoft Excel (extension ".xlsx") are supported by the command. You must pass a full path, unless the document is located at the same level as the database structure file, in which case you can just pass its name.

Note: When importing a Microsoft Excel-formatted file into a 4D View Pro document, some settings may be lost. You can verify your settings with this list from GrapeCity.

An error is returned if the filePath parameter is invalid, or if the file is missing or malformed.

The optional paramObj parameter allows you to define properties for the imported document:

 

PropertyTypeDescription
formulaobjectA callback method name to be launched when the import has completed. The method must use the Formula command. See Passing a callback method (formula).
passwordtextMicrosoft Excel only (optional) - The password used to protect a MS Excel document. 

 

 

You want to import a default 4D View Pro document stored on the disk when the form is open:

 C_TEXT($docPath)
 If(Form event code=On VP Ready//4D View Pro area loaded and ready
    $docPath:="C:\\Bases\\ViewProDocs\\MyExport.4VP"
    VP IMPORT DOCUMENT("VPArea";$docPath)
 End if

You want to import a password protected Microsoft Excel document into a 4D View Pro area:

 $o:=New object
 $o.password:="excel123"
 
 VP IMPORT DOCUMENT("ViewProArea";"c:\\tmp\\excelfilefile.xlsx";$o)



See also 

VP EXPORT DOCUMENT
VP NEW DOCUMENT

 
PROPERTIES 

Product: 4D
Theme: 4D View Pro Language
Number: 905265

 
PAGE CONTENTS 
 
HISTORY 

Created: 4D v16 R4
Modified: 4D v17 R3

 
ARTICLE USAGE

4D View Pro Reference ( 4D v19)