Word.SectionStart enum
指定した項目のセクション区切りを指定します。
注釈
使用元
例
// 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.");
});
フィールド
| continuous = "Continuous" | [現在の位置から開始] セクション区切り |
| evenPage = "EvenPage" | 同等のページ セクション区切り。 |
| newColumn = "NewColumn" | [次の段から開始] セクション区切り |
| newPage = "NewPage" | [次のページから開始] セクション区切り |
| oddPage = "OddPage" | 奇数ページのセクション区切り。 |