Many COM libraries provide constant values you can use while working with the properties and methods in the library. To use a constant from the library, use the dot notation to indicate the library that defines the constant. The following example uses the wdWindowStateMinimize constant to minimize the active window in Microsoft Word. Notice that the constant uses the dot notation to qualify that it is defined in the Word object library.
local Word.Application app; local Word.Window active_win; {Retrieve a reference to Microsoft Word} app = COM_GetObject("Word.Application"); {Minimize the active window} active_win = app.ActiveWindow; active_win.WindowState = Word.wdWindowStateMinimize;
Always use COM constants when possible. They make your COM code much easier to read. |