写入一段连续的话

插入换行符

插入新的页面

word = actxserver('Word.Application');      %start Word
%设置页面可见
word.Visible =1;                            %make Word Visible
%创建新的word文档
document=word.Documents.Add;                %create new Document
selection=word.Selection;                   %set Cursor
%写入一段连续的话
selection.TypeText('你好');
selection.TypeText('今天是一个好日子');
%插入换行符
selection.TypeParagraph; 
%插入新的页面
selection.InsertNewPage;

效果如下

 

更多推荐

【MATLAB基础】MATLAB与Word互联(4)