How to add your knowledge

COM_methodCall_()

    Table of contents
    1. 1. Synopsis
    2. 2. Syntax
    3. 3. Example 1
    4. 4. Example 2

    Synopsis

    Invokes the method "name" on the COM Object with IDispatch pointer disp passing args as the arguments. Returns the Any as a returned value of the COM method.

    Syntax

    COM_methodCall_ ( serverHandle As User, _
                       Name As String, Optional reuseID As String = "", _
                       Optional checkArguments? As Boolean = False, _
                       ... args As Any ) As Any 
    Name Type Description
    serverHandle User IDispatch pointer
    Name String Method name
    reuseID String Optional; obsolete; default is "".
    checkArguments? Boolean Optional; checks the validity of the arguments if True; default is False.
    args Any Optional; additional arguments for the method.

    Example 1

    Saves the workbook in Excel

    COM_methodCall_(workbook, "Save") 

    Example 2

    Moves the Inventor Window to the specified position

    Method moveInventorWindow( top As Integer, left As Integer, height As Integer, width As Integer) 
        Dim inventor As User = COM_connectRunningServer_("Inventor.Application")
        COM_methodCall_( inventor, "Move", top, left, height, width) 
        COM_releaseDispatch_( inventor)
        Return displayName
    End Method