Word.SectionStart enum
Specifies the type of section break for the specified item.
Remarks
Used by
Examples
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/50-document/manage-section-starts.yaml
await Word.run(async (context) => {
// Configure document-wide page settings for a report that will be printed and bound.
const pageSetup: Word.PageSetup = context.document.pageSetup;
pageSetup.set({
paperSize: Word.PaperSize.letter,
orientation: Word.PageOrientation.portrait,
topMargin: 72,
bottomMargin: 72,
leftMargin: 90,
rightMargin: 72,
gutter: 18,
gutterPosition: Word.GutterPosition.left,
mirrorMargins: true,
oddAndEvenPagesHeaderFooter: true
});
const sections: Word.SectionCollection = context.document.sections;
sections.load("items");
await context.sync();
// Start the main chapter on an odd-numbered page so it appears on the right in a bound document.
const chapterPageSetup: Word.PageSetup = sections.items[1].pageSetup;
chapterPageSetup.sectionStart = Word.SectionStart.oddPage;
chapterPageSetup.differentFirstPageHeaderFooter = true;
// Keep the appendix in a separate section, but let it begin on the current page.
sections.items[2].pageSetup.sectionStart = Word.SectionStart.continuous;
await context.sync();
console.log("Applied print and binding settings to the report.");
});
Fields
| continuous = "Continuous" | Continuous section break. |
| evenPage = "EvenPage" | Even page section break. |
| newColumn = "NewColumn" | New column section break. |
| newPage = "NewPage" | New page section break. |
| oddPage = "OddPage" | Odd page section break. |