function ceshi_Word
%设定测试Word文件名和路径
filespec_user=[pwd '测试.doc'];
%判断Word是否已经打开,若已打开,就在打开的Word中进行操作,
%否则就打开Word
try
Word = actxGetRunningServer('Word.Application');
catch
Word = actxserver('Word.Application');
end;
%设置Word属性为可见
set(Word, 'Visible', 1);
%返回Word文件句柄
documents = Word.Documents;
%若测试文件存在,打开该测试文件,否则,新建一个文件,并保存,文件名为测试.doc if exist(filespec_user,'file');
document = invoke(documents,'Open',filespec_user);
else
document = invoke(documents, 'Add');
document.SaveAs(filespec_user);
end
content = document.Content;
selection = Word.Selection;
paragraphformat = selection.ParagraphFormat;
%页面设置(上下左右边距
最后
以上就是可耐月饼最近收集整理的关于matlab打开word里的图片,Matlab往Word里面插入图片范例代码的全部内容,更多相关matlab打开word里内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复