I don't understand what this function is doing 'Invoke'

2 ビュー (過去 30 日間)
Md Jonayet
Md Jonayet 2023 年 3 月 23 日
編集済み: Stephen23 2023 年 3 月 24 日
I am trying to understand this function below.
hfind is deal with msword. It is basically searching for the tag in the ms file template.
fromstr = is a tagname inside of the msword. For example <name>
tostr = is a name of the user which is replace fromstr from the nameplace.
but what these 0, 0, 0, 0, 1, 1, 0 is doing? also that 2 at the end?
I will appreciate a lot
function reportgen_replace(hfind, fromstr, tostr)
% Execute the replacement
invoke(hfind, 'Execute', fromstr, 0, 0, 0, 0, 0, 1, 1, 0, tostr, 2);

回答 (1 件)

Stephen23
Stephen23 2023 年 3 月 23 日
編集済み: Stephen23 2023 年 3 月 24 日
"but what these 0, 0, 0, 0, 1, 1, 0 is doing? also that 2 at the end?"
Those are inputs to some COM object's method. The method is named "Execute": https://www.mathworks.com/help/matlab/ref/com.invoke.html
So you need to look up the documentation for that COM object (which you have told us nothing about). That COM object is a most likely a Microsoft product (so you should be looking at MS for that information, not here):
  1 件のコメント
Md Jonayet
Md Jonayet 2023 年 3 月 23 日
移動済み: Cris LaPierre 2023 年 3 月 23 日
Thank you Stephen23. It is a big help for me.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by