Documents
Use
You define it with reference to the interface i_oi_document_proxy. Each instance of this type controls a document that you open in the office application. If you want to open several documents at once, you need an instance for each document. The interface exposes methods that you can use to control the document from your application program (for example, open, close, save).
Prerequisites
Before creating the document instance, you must create a central instance of type i_oi_container_control for Managing Desktop Office Integration.
The following diagram shows the process of editing a document:
Process
-
Declaration:
Declare an instance with reference to interface i_oi_document_proxy:
DATA: document TYPE REF TO I_OI_DOCUMENT_PROXY.
-
Initialization:
Create the instance for the document by using the method get_document_proxy on the central administration instance for Managing the Desktop Office Integration.
-
In your application program, assign a handler method to the events that could be triggered in the document.
-
Open a document. For existing documents, use the open_document (change mode), view_document (display mode for metadata), or play_document (play a document) methods. To create a new document, use the create_document method.
-
Editing:
Edit your document and save any changes.
-
You can find out the attributes of the instance document using the following methods:
Method
Function
is_open
Document is open in the office application
is_destroyed
Document is not open (empty container)
get_document_type
Type of document
has_changed
Document has changed
get_document_handle
Determines the handle of a document
has_standard_interface
Determines whether the document has a standard interface
-
Closing:
When you have edited the document, use the method close_document to close the document or react to the event on_close_event that is triggered when the office application user closes the document.
-
Save the changes in the document document <document> using the method save_document_to_url. Then release the memory occupied using the method release_document.