This commit is contained in:
csh
2023-07-14 10:33:49 +08:00
parent f34d03a50f
commit 845c6bb554
5 changed files with 44 additions and 26 deletions
+21 -21
View File
@@ -84,7 +84,7 @@ Function _0_AddTitle(docx);
Begin
_PrintMsg('AddTitle');
p := _AddTitle(docx, '天软DOCX文档操作接口帮助文档', 0);//添加文档标题
p.Font.Size := 48;
p.Font.Size := 24;
p.Apply();
for i:=0 to 16 do
docx.AddLineBreak(-1);//换行符
@@ -132,7 +132,7 @@ Begin
preface.Font.Name := '宋体';
preface.Font.Color := 'FF0000';
preface.Font.Bold := true;
preface.Font.Size := 32;
preface.Font.Size := 16;
p1 := docx.AddParagraph(preface, -1, nil);
println(' >>OK\n');
@@ -303,7 +303,7 @@ Begin
p1.Run.SetText('本文档由天软科技制作。');
p1.Run.rPr.Name := '宋体';
p1.Run.rPr.Bold := true;
p1.Run.rPr.Size := 32;
p1.Run.rPr.Size := 16;
p1.Run.rPr.Color := 'FF0000';
p2 := docx.AddParagraph(p1, -1, nil);
//插入批注
@@ -391,7 +391,7 @@ Begin
p1.Run.SetText( '插入案例。' );
p1.Run.rPr.Name := '宋体';
p1.Run.rPr.Bold := true;
p1.Run.rPr.Size := 32;
p1.Run.rPr.Size := 16;
p1.Run.rPr.Color := 'FF0000';
pAddRevision := docx.AddParagraph(p1, -1, nil);
//插入修订
@@ -410,7 +410,7 @@ Begin
p1.Run.SetText( '删除修订案例。' );
p1.Run.rPr.Name := '宋体';
p1.Run.rPr.Bold := true;
p1.Run.rPr.Size := 32;
p1.Run.rPr.Size := 16;
p1.Run.rPr.Color := 'FF0000';
pDelRevision := docx.AddParagraph(p1, -1, nil);
//删除修订
@@ -500,7 +500,7 @@ Begin
help.Font.Name := '宋体';
help.Font.Color := 'FF0000';
help.Font.Bold := true;
help.Font.Size := 30;
help.Font.Size := 15;
p1 := docx.AddParagraph(help, -1, nil);
section := docx.Sections(-1);//获取缺省章节
@@ -514,10 +514,10 @@ Begin
p.Format.SpaceAfter := 0;
p.Font.Name := '宋体';
p.Font.Color := 'FF0000';
p.Font.Size := 16;
p.Font.Size := 8;
p2 := footer.AddParagraph(p, -1, nil);
p.Font.Size := 18;
pgno := footer.AddPageNumber('第 {0} 页,共 {1} 页', p.Font); //添加页码
p.Font.Size := 8;
pgno := footer.AddPageNumber('第 {-3} 页,共 {1} 页', p.Font); //添加页码
pgno.Format.Alignment := 'center'; //据中对齐
pgno.Format.SpaceAfter := 0;
pgno.Apply();
@@ -530,7 +530,7 @@ Begin
//p.Format.Bdr.Bottom.val := 'single';//页眉横线
p.Font.Name := '宋体';
p.Font.Color := 'FF0000';
p.Font.Size := 16;
p.Font.Size := 8;
p1 := header.AddParagraph(p, -1, nil);
println(' >>OK\n');
@@ -583,19 +583,19 @@ Begin
pTest := docx.AddParagraph(p1, -1, nil);
//修改部分文字字体
range := pTest.Range(3,2);
range.Font.Size := 32;
range.Font.Size := 16;
range.Font.Color := 'FF0000';
range.Font.Bold := true;
range.Apply();
//添加文字1
range1 := pTest.AddText(5, '科技开发有限');
range1.Font.Size := 28;
range1.Font.Size := 14;
range1.Font.Color := '00FF00';
range1.Font.Bold := true;
range1.Apply();
//添加文字2
range2 := pTest.AddText(0, '广东省');
range2.Font.Size := 28;
range2.Font.Size := 14;
range2.Font.Color := '0000FF';
range2.Font.Bold := true;
range2.Apply();
@@ -603,7 +603,7 @@ Begin
//r.Text := 'Tinysoft';
r := pTest.AddText(-1, ':www.tinysoft.com.cn');//段落后追加
r.Font.Size := 20;
r.Font.Size := 10;
r.Font.Color := '0000FF';
r.Font.Bold := true;
r.Apply();
@@ -656,7 +656,7 @@ Begin
p := TOfficeObj('TParagraph');
p.Format.numPr.Level := 0;//项目编号
p.Format.numPr.numId := docx.NumberingObject().NumberId('bullet', i); //项目编号
p.Font.Size := 28;
p.Font.Size := 14;
p.Font.Color := 'FF0000';
p.Font.Bold := true;
p.Format.LeftIndent := 700;//段落左边距
@@ -829,7 +829,7 @@ Begin
p.Font.Name := '宋体';
p.Font.Color := 'FF0000';
p.Font.Bold := true;
p.Font.Size := 29;
p.Font.Size := 15;
p1 := docx.AddParagraph(p, -1, nil);
println(' >>OK\n');
@@ -940,10 +940,10 @@ Function _AddClassHelpTable(docx, data);
Begin
//设置边框属性
tbl := docx.CreateTable(data, true, true);
tbl.Format.Borders.Top.Size := 24;
tbl.Format.Borders.Left.Size := 24;
tbl.Format.Borders.Bottom.Size := 24;
tbl.Format.Borders.Right.Size := 24;
tbl.Format.Borders.Top.Size := 12;
tbl.Format.Borders.Left.Size := 12;
tbl.Format.Borders.Bottom.Size := 12;
tbl.Format.Borders.Right.Size := 12;
tbl.Format.Borders.Top.Val := 'thinThickThinMediumGap';
tbl.Format.Borders.Left.Val := 'thinThickThinMediumGap';
tbl.Format.Borders.Bottom.Val := 'thinThickThinMediumGap';
@@ -1144,7 +1144,7 @@ Begin
if title then Begin
p.Format.numPr.Level := 0;//项目编号
p.Format.numPr.numId := numId;
p.Font.Size := 28;
p.Font.Size := 14;
p.Font.Color := 'FF0000';
p.Font.Bold := true;
p.Format.LeftIndent := 500;//段落左边距