The following steps explain how to use an OLE automation object:
The next sample code illustrates an action diagram fragment that opens Microsoft Word and places the traveler's name into a field in a document.
1- --- EVENT ACTION word open
2- | SET local guiobj word TO APPLICATION CreatObject(T:Word.Basic) 3- | INVOKE local guiobj word AppShow() 4- | INVOKE local guiobj word AppMaximize() 5- | INVOKE local guiobj word FileOpen (T:d:\reservation.doc) 6- | INVOKE local guiobj word EditGoTo (T:person) 7- --- INVOKE local guiobj word InsertField (T:export_selected_customer)
The following table explains the sample code:
|
Line |
Action |
|---|---|
|
1 |
Builds an event to open a Word document and place information into it. This is the equivalent of the dimension statement (Step 1). |
|
2 |
Sets a local view guiobj word to the CreateObject type library from Word. This creates the object (Step 2 object). |
|
3 |
Invokes a method to show the Word application. |
|
4 |
Invokes a method Word makes available to maximize the application (in this case the application is already running on the desktop). |
|
5 |
Invokes a method to open the Word document reservation.doc. |
|
6 |
Invokes a method to go the person place holder. |
|
7 |
Invokes a method to insert the export view of the selected customer into the person place holder. |
|
Copyright © 2013 CA.
All rights reserved.
|
|