Salesforce

How Do I Define the COM Object that I Want to Use? (Magic xpa 3.x)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

How Do I Define the COM Object That I Want to Use? (Magic xpa 3.x)

Before you can use a COM object, you have to declare it. A COM object is defined in Magic xpa like any other variable, in the Data section of your task.

Defining a COM object is a little more work than say, defining a date variable or a text field. You have to select from a list of libraries, and within each library, you have to select from what can be a very large list of objects. Also, COM objects are often used to link to other products, such as Word or Excel, and you may have to modify the COM definition when new versions of those products are installed.

For these reasons, it is recommended that you declare your COM definitions as Models and reuse them as needed. See How Do I Re-use COM Object Definitions?.

Defining a COM object

  1. Open up a line in the Model repository (F4 or Edit->Create Line).

  2. Type anything you like in the Name column.

  3. Leave the default Class (Field).

  4. Set the Attribute to OLE.

  5. From the Type Library property, zoom to select the library you want to use. The library list can be very large; all the libraries installed on your computer are listed. You can type the first letter to get to the section you want. Press Enter to select the library you want to use.

  1. From the Object name property, zoom to select the object you want from this library.

  2. Select the Sub object in the same way, if needed.

Now, you can use this model to declare COM objects in your tasks. Just select it as you would any other model when declaring a variable.

Note: A person might reasonably ask, seeing all the choices from within a COM library, how one knows which object to pick. Basically, a COM library is like a huge function list. You don’t really know which functions you need unless you read the documentation that is produced by whoever wrote the library (the Microsoft developer documentation for Word, for instance). Nevertheless, Magic xpa makes it rather easy to just experiment with the objects and often you can just figure them out by working with them.

Reference
Attachment 
Attachment