如何用DELPHI控制WORD 中表格边框的宽度

hsqtl 2006-12-15 10:42:43
WordD: TWordDocument;

WordD.Tables.Add(WordD.Sentences.Last,2,2,Template,NewTemplate) ;

with WordD.Tables.Item(1) do begin


Cell(1,1).Range.Borders.Shadow := False;

Cell(1,1).Range.Text:='第一列';
Cell(1,2).Range.Text:='第二列';
end;
设置这个表的边框
...全文
422 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
hsqtl 2006-12-16
  • 打赏
  • 举报
回复
感谢 ! 问题解决。
老冯 2006-12-15
  • 打赏
  • 举报
回复
type
WdLineWidth = TOleEnum;
const
wdLineWidth025pt = $00000002;
wdLineWidth050pt = $00000004;
wdLineWidth075pt = $00000006;
wdLineWidth100pt = $00000008;
wdLineWidth150pt = $0000000C;
wdLineWidth225pt = $00000012;
wdLineWidth300pt = $00000018;
wdLineWidth450pt = $00000024;
wdLineWidth600pt = $00000030;
老冯 2006-12-15
  • 打赏
  • 举报
回复
uses
Word2000;

var
_Cell: Cell;

........................
_Cell.Borders.InsideLineWidth := 2;
_Cell.Borders.OutsideLineWidth := 2;

......................
踢踏 2006-12-15
  • 打赏
  • 举报
回复
参考下:
With Selection.Cells
With .Borders(wdBorderLeft)
.LineStyle = wdLineStyleDashSmallGap
.LineWidth = wdLineWidth450pt
.Color = wdColorAutomatic
End With
With .Borders(wdBorderRight)
.LineStyle = wdLineStyleDashSmallGap
.LineWidth = wdLineWidth450pt
.Color = wdColorAutomatic
End With
With .Borders(wdBorderTop)
.LineStyle = wdLineStyleDashSmallGap
.LineWidth = wdLineWidth450pt
.Color = wdColorAutomatic
End With
With .Borders(wdBorderBottom)
.LineStyle = wdLineStyleDashSmallGap
.LineWidth = wdLineWidth450pt
.Color = wdColorAutomatic
End With
With .Borders(wdBorderHorizontal)
.LineStyle = wdLineStyleDashSmallGap
.LineWidth = wdLineWidth450pt
.Color = wdColorAutomatic
End With
.Borders(wdBorderDiagonalDown).LineStyle = wdLineStyleNone
.Borders(wdBorderDiagonalUp).LineStyle = wdLineStyleNone
.Borders.Shadow = False
End With

5,928

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧