ใช้การจัดรูปแบบแบบกำหนดเองกับฟิลด์
Contents
[
Hide
]
บางครั้งผู้ใช้จำเป็นต้องใช้การจัดรูปแบบแบบกำหนดเองกับฟิลด์ ในบทความนี้ เราจะดูตัวอย่างสองสามตัวอย่างว่าสามารถทำได้อย่างไร
หากต้องการเรียนรู้ตัวเลือกเพิ่มเติม โปรดดูรายการคุณสมบัติทั้งหมดสำหรับช่องแต่ละประเภทในคลาสที่เกี่ยวข้องใน โมดูลฟิลด์
วิธีประเมินเงื่อนไข IF
หากคุณต้องการประเมินเงื่อนไข IF
หลังจาก Mail Merge คุณสามารถใช้วิธี EvaluateCondition ที่จะส่งคืนผลลัพธ์ของการประเมินนิพจน์ทันที
ตัวอย่างโค้ดต่อไปนี้แสดงวิธีการใช้วิธีนี้:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Python-via-.NET | |
builder = aw.DocumentBuilder() | |
field = builder.insert_field("IF 1 = 1", None).as_field_if() | |
actualResult = field.evaluate_condition() | |
print(actualResult) |