Enum ParagraphHeading

ย่อหน้าส่วนหัว

การแจกแจงหัวข้อย่อหน้ามาตรฐาน

หากต้องการเรียกใช้ enum ให้เรียกคลาสหลัก ชื่อ และพร็อพเพอร์ตี้ของ enum นั้น เช่น DocumentApp.ParagraphHeading.NORMAL

ใช้การแจกแจง ParagraphHeading เพื่อกําหนดค่ารูปแบบหัวข้อสําหรับ ParagraphElement

const body =     DocumentApp.getActiveDocument().getActiveTab().asDocumentTab().getBody();  // Append a paragraph, with heading 1. const par1 = body.appendParagraph('Title'); par1.setHeading(DocumentApp.ParagraphHeading.HEADING1);  // Append a paragraph, with heading 2. const par2 = body.appendParagraph('SubTitle'); par2.setHeading(DocumentApp.ParagraphHeading.HEADING2);  // Append a paragraph, with normal heading. const par3 = body.appendParagraph('Text'); par3.setHeading(DocumentApp.ParagraphHeading.NORMAL);

พร็อพเพอร์ตี้

พร็อพเพอร์ตี้ประเภทคำอธิบาย
NORMALEnumตัวเลือกส่วนหัวสำหรับข้อความปกติ
HEADING1Enumตัวเลือกส่วนหัวที่สูงที่สุด
HEADING2Enumตัวเลือกส่วนหัวที่ 2
HEADING3Enumตัวเลือกส่วนหัวที่ 3
HEADING4Enumตัวเลือกส่วนหัวที่ 4
HEADING5Enumตัวเลือกส่วนหัวที่ 5
HEADING6Enumตัวเลือกส่วนหัวที่ต่ำที่สุด
TITLEEnumตัวเลือกส่วนหัวของชื่อ
SUBTITLEEnumตัวเลือกส่วนหัวของคำบรรยาย