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

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;//段落左边距

View File

@ -1,4 +1,4 @@
// Version 1.3.4
// Version 1.3.5
Function TOfficeObj(n);
Begin
@ -5851,7 +5851,7 @@ type TwrPr=class(NodeInfo)
,("field":"Strike","name":"w:strike","obj":Strike,"attrEx":"","nodeType":"empty","attrName":"", "desc":"单个删除线", "class":"")
,("field":"dStrike","name":"w:dstrike","obj":dStrike,"attrEx":"w:val","nodeType":"","attrName":"", "desc":"两个删除线", "class":"")
,("field":"kern","name":"w:kern","obj":kern,"attrEx":"w:val","nodeType":"","attrName":"", "desc":"字体紧排", "class":"")
,("field":"Size","name":"w:sz","obj":Size,"attrEx":"w:val","nodeType":"","attrName":"", "desc":"字体大小", "class":"")
,("field":"Sz","name":"w:sz","obj":Sz,"attrEx":"w:val","nodeType":"","attrName":"", "desc":"字体大小", "class":"")
,("field":"szCs","name":"w:szCs","obj":szCs,"attrEx":"w:val","nodeType":"","attrName":"", "desc":"复杂脚本字体大小", "class":"")
,("field":"U","name":"w:u","obj":U,"attrEx":"w:val","nodeType":"","attrName":"", "desc":"下划线", "class":"")
,("field":"vertAlign","name":"w:vertAlign","obj":vertAlign,"attrEx":"w:val","nodeType":"","attrName":"", "desc":"对齐方式.", "class":"")
@ -5878,6 +5878,16 @@ type TwrPr=class(NodeInfo)
rFont.XMLhAnsi := nName;
rFont.XMLascii := nName;
End;
Property Size read readSize write writeSize;
Function writeSize(n);
Begin
Sz := n * 2;
End;
Function readSize();
Begin
return int(Sz / 2);
End;
//Attributes
@ -5891,7 +5901,7 @@ type TwrPr=class(NodeInfo)
Strike;
dStrike;
kern;
Size;
Sz;
szCs;
U;
vertAlign;

View File

@ -1,4 +1,4 @@
// Version 1.3.4
// Version 1.3.5
Type TSDocxFile = Class
///Version: V1.0 2022-09-20

View File

@ -1,4 +1,4 @@
// Version 1.3.4
// Version 1.3.5
Type TSExcelFile = Class
///Version: V1.0 2022-08-08

View File

@ -1,5 +1,13 @@
# 更新日志
## 2023-7-14
### V1.3.5
#### word
段落字体大小设置调整对齐VBA设置
## 2023-7-11
### V1.3.4