Sections/section object usage of VBA programming for Word documents

Source: Internet
Author: User

The following content is related to the sections or Section object of VBA programming in Word documents, and you want to help.

ActiveDocument.Sections.First ' The first section of the current document

ActiveDocument.Sections.First.PageSetup.BottomMargin ' The bottom margin of the page where the first section of the current document is located

ActiveDocument.Sections.First.PageSetup.LeftMargin ' The left margin of the page in the first section of the current document

ActiveDocument.Sections.First.PageSetup.RightMargin ' right margin of the page where the first section of the current document is located

ActiveDocument.Sections.First.PageSetup.TopMargin ' top margin of the page in the first section of the current document

ActiveDocument.Sections.First.PageSetup.PaperSize ' Returns or sets the size of the page in the first section of the current document

ActiveDocument.Sections.First.PageSetup.PageHeight ' Returns or sets the height of the page in the first section of the current document

ActiveDocument.Sections.First.PageSetup.PageWidth ' Returns or sets the width of the page in the first section of the current document

ActiveDocument.Sections.Add Range:=myrange ' Add a new section to the current document

ActiveDocument.Sections.Item (2) ' The second section of the current document

ActiveDocument.Sections.Last.Range.InsertAfter "End of document!" ' Add text to the end of the last section in the current document ' End of document!

The above content and have a certain VBA knowledge of netizens use.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.