我是在MATLAB中使用activex控件的新手。我试图控制一个word文档。我想,我需要帮助翻译VBA语法和Matlab。如何在MATLAB中对以下代码进行编码?将VBA语法转换为Matlab,用于Word文档的Activex控件
Sub macro()
With CaptionLabels("Table")
.NumberStyle = wdCaptionNumberStyleArabic
.IncludeChapterNumber = True
.ChapterStyleLevel = 1
.Separator = wdSeparatorHyphen
End With
Selection.InsertCaption Label:="Table", TitleAutoText:="", Title:="", _
Position:=wdCaptionPositionAbove, ExcludeLabel:=0
End Sub
谢谢,我看着帮助和来源,但我仍然感到密集。我希望能够在自动报告中控制标题编号和标题文本。我正在使用表格和数字。我无法理解如何编码字幕的添加。
下面的代码让我参与到那里。但是我不掌握编号风格等。我试图找出activex结构,但我无法理解它。特别是,特别是上面的VB子程序的第一位。
% Start an ActiveX session with Word
hdlActiveX = actxserver('Word.Application');
hdlActiveX.Visible = true;
hdlWordDoc = invoke(hdlActiveX.Documents, 'Add');
hdlActiveX.Selection.InsertCaption('Table',captiontext);