Word template-new Wizard

Source: Internet
Author: User
Wizard

In word 2010 Bible, a new wizard is displayed when you create a file based on it. Then, I especially want to implement this function, such as creating several sections and creating directories.

Ran to the http://word.mvps.org to search for the next, and indeed there is a method, simply put, is in the thisdocument template project, create a document_new () process, and implement it. To put it bluntly, it is:

  1. Double-click thisdocument
  2. There are two combos at the top of the editing area opened on the right. Select the document in the box on the left. You will find that word automatically creates a document_new process.
  3. Add a custom form and make it a wizard.
Page settings

After the Wizard is complete, page settings are generally required. I read the Help file for half a day and learned about section. the members of pagesetup are not easy to handle. Later, they found that they only need to find an empty file, record a macro according to the page settings, and copy it.

It is worth noting that:In the last page, set the number of lines and spans on each page of the Grid. Only linespage can be set in VBA. The word calculates the span = (pageheight-topmargin-bottommargin) based on this value) /linespage. You can modify the span in the page settings, and word also responds (that is, a page may not be an integer line), but VBA cannot do this, very crashing ~~

Header and footer

The header and footer are set by section. headers and section. footers,

  1. Wdheaderfooterprimary: odd page
  2. Wdheaderfooterevenpages: Even page
  3. Wdheaderfooterfirstpage: Home Page

You can add a page number to the footer. The page number is represented by the field {page}. To control the page style or re-number, you need to use

  • Section. footers. pagenumbers. restartnumberingatsection: whether to re-start the number in this section
  • Section. footers. pagenumbers. startingnumber: Start
  • Section. footers. pagenumbers. numberstyle: numbered Style

Note:: The section. footers. pagenumbers. Add method is not required to add the page number. You can directly add the page field to footers (INDEX). range.

Note:: You need to set the linktoprevious attribute of the header and footer from section 2nd. When setting the range attribute, you need to call range. Delete first, otherwise there will be the header and footer content in the previous section.

Add a directory and update a directory

Adding directories and updating directories are special. It seems difficult to directly insert and update TOC fields.

Add directory: Activedocument. tablesofcontents. Add

Update directory: Activedocument. tablesofcontents (1). Update

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.