How to write into an existing MS Word document table ?

9 ビュー (過去 30 日間)
Marc Servagent
Marc Servagent 2021 年 10 月 5 日
回答済み: Marc Servagent 2021 年 10 月 6 日
Hello,
I use a word template document with an existing table inside.
I need to write some text inside the table, however I can not find the right command to move the selection into the table.
I use actxserver:
Word = actxserver('Word.Application');
Word.Visible = true
doc = invoke(Word.Documents,'Open','template.docx');
selection=Word.Selection;
I know the commands to create a table and then write into it, but I can not find the commands to write into an existing table.
Thanks in advance

採用された回答

Marc Servagent
Marc Servagent 2021 年 10 月 6 日
I actually found myself the solution:
Word.Selection.GoTo(2,2)
% 2: wdGoToTable
% 2: wdGoToNext
% https://docs.microsoft.com/fr-fr/office/vba/api/word.selection.goto
Then move into the table with:
Word.Selection.MoveDown
Word.Selection.MoveLeft
Word.Selection.MoveRight
...

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeUse COM Objects in MATLAB についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by