更新日期字段
将当前日期设置到文档中的所有日期表单字段中。
(function () {
let doc = Api.GetDocument();
let forms = doc.GetAllForms();
forms.forEach((form) => {
if (form.GetFormType() === "dateForm") {
form.SetFormat("dddd, dd MMMM yyyy");
form.SetLanguage("en-CA");
form.SetBackgroundColor(255, 0, 0); // 设置背景颜色为红色。
}
});
})();
使用方法: GetDocument, GetAllForms, GetFormType, SetFormat, SetLanguage, SetBackgroundColor
结果