# COM\_invoke

Invoke method on COM object or interface.

## Syntax

* S = invoke(h, methodname, arg1, arg2, ...)
* S = COM\_invoke(h, methodname, arg1, arg2, ...)

## Input argument

* h - a COM object.
* methodname - a string: the method name invoked on COM object.
* arg1, arg2, ... - a Nelson variable of type double, int, boolean, string, ... used as parameters of COM function invoked.

## Output argument

* S - a COM object or data.

## Description

If the method returns a COM interface, then ole\_invoke returns a new COM object that represents the returned interface.

## Example

```matlab
pWord = actxserver('Word.Application')
pWord.Visible = true
invoke(pWord, 'Quit')
delete(pWord)
clear pWord
```

## See also

[COM\_get](com_get), [COM\_set](com_set).

## History

| Version | Description     |
| ------- | --------------- |
| 1.0.0   | initial version |

## Author

Allan CORNET
