如何将Word文档页面布局设置为MATLAB中的2列,
File='C:\Users\ies\Documents\MATLAB\test.docx'; %use full path
[pth,name,ext]=fileparts(file);
w=Word(file,true); %create document and make visible
addText(w,'Introduction','Heading 1',2); %create a heading, 2 spaces after
addText(w,recognizedText); %add some text
newline(w,6); %6 newlines
pic=sprintf('%s/fig.png',pth);
saveAs(w,file);以上代码以普通模式Word文件保存文本,但我需要两列。
发布于 2015-10-24 00:59:14
Word函数不是标准的MATLAB函数。如果不提供它来自何处的详细信息,就不可能确切地说出它的返回值w是什么,或者如何与它交互。但是,由于其他非标准函数似乎将其视为Word Document对象,因此我们假设它是其中之一的COM接口。
在这种情况下,可以使用以下方法将列数设置为两列:
w.ActiveWindow.Selection.Sections.First.PageSetup.TextColumns.SetCount(2)https://stackoverflow.com/questions/32781004
复制相似问题