필터 지우기
필터 지우기

I want to add the author's name and title of word document file using the matlab code. I get the error: 'Index exceeds matrix dimensions'.

조회 수: 5 (최근 30일)
I used following code:
filepath_target = 'C:\New_folder\temp.docx';
word = actxserver('Word.Application'); % start Word
word.Visible = 1; % make Word invisible (set to 1 to make Word visible)
document = word.Documents.Open(filepath_target); % open template
document.BuiltInDocumentProperties('Title').Value = 'set the title'; %Error
document.BuiltInDocumentProperties('Author').Value = 'set the Author name'; %Error
The error was same for both of these code: 'Index exceeds matrix dimensions'.
please share me the solution.

답변 (1개)

Image Analyst
Image Analyst 2023년 5월 16일
See Mathworks support article:
If that doesn't work, write back. And attach a Word document that it's not working for.
  댓글 수: 2
Image Analyst
Image Analyst 2023년 5월 16일
If this Answer solves your original question, then could you please click the "Accept this answer" link to award the answerer with "reputation points" for their efforts in helping you? They'd appreciate it. Thanks in advance. 🙂 Note: you can only accept one answer (so pick the best one) but you can click the "Vote" icon for as many Answers as you want. Voting for an answer will also award reputation points.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 ActiveX에 대해 자세히 알아보기

제품


릴리스

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by