卡饭网 > word > 正文

Word文档VBA编程之Sections/Section对象用法

来源:本站整理 作者:梦在深巷 时间:2013-04-03 23:38:45

以下内容与Word文档VBA编程的Sections或Section对象有关,希望对您有所帮助。

ActiveDocument.Sections.First '当前文档的第一节

ActiveDocument.Sections.First.PageSetup.BottomMargin '当前文档第一节所在页的底边距

ActiveDocument.Sections.First.PageSetup.LeftMargin '当前文档第一节所在页的左边距

ActiveDocument.Sections.First.PageSetup.RightMargin '当前文档第一节所在页的右边距

ActiveDocument.Sections.First.PageSetup.TopMargin '当前文档第一节所在页的顶边距

ActiveDocument.Sections.First.PageSetup.PaperSize '返回或设置当前文档第一节所在页的大小

ActiveDocument.Sections.First.PageSetup.PageHeight '返回或设置当前文档第一节所在页的高度

ActiveDocument.Sections.First.PageSetup.PageWidth '返回或设置当前文档第一节所在页的宽度

ActiveDocument.Sections.Add Range:=myRange '在当前文档中添加新节

ActiveDocument.Sections.Item(2) '当前文档中的第二节

ActiveDocument.Sections.Last.Range.InsertAfter "文档结束!" '在当前文档中最后一节的结尾添加文字“文档结束!”

以上内容与具备一定VBA知识的网友使用。

相关推荐