Open MethodOfficial Content
Opens the specified document.  

Syntax

&DataType.Open(FileName)

Type Returned:
ExcelDocument and WordDocument return a Numeric type; so it is possible to call it as a function (&Err = &DataType.Open(…..)).
For Xml Data types, an ErrCode Data type property is provided for handling errors.

Where:
FileName
Is the path and name of the document. If only the name is specified, the document will be created in the default directory (DataXXX model directory).

Description

ExcelDocument and WordDocument: If the specified document does not exist, it is created by using the template specified in the Template property. 
When you open a document with the Open method, it is not displayed on the screen. To show it, you must call the Show method. 

XmlWriter: If you do not include the FileName, it is generated by ‘standard output’. When it is a web object it is generated in the response. (It works with CGI, ISAPI, WebClasses and Servlets).

Tip: If you need to know if the spreadsheet already exists you can use file.exists()

Scope

Extended Data Types: ExcelDocument, WordDocument, XmlWriter, XmlReader
Languages: .NET, Java, Ruby (up to GeneXus X Evolution 3), Visual FoxPro (up to GeneXus X Evolution 3)

See Also

Show Method
Template Property
ExcelDocument Data Type
WordDocument Data Type
XmlWriter Data Type
XmlReader Data Type



Was this page helpful?
What Is This?
Your feedback about this content is important. Let us know what you think.