asp操作word,如何设置表格边框的线型?

lhb2000 2018-03-05 10:53:35
asp操作word,如何设置表格边框的线型?我要生成的表格四周为粗边框,及表格行间距为固定12磅,要如何操作?录制宏的VBA用了没效果。
我的部分代码
Set tabCurrent = oapp.Application.ActiveDocument.Tables.Add (oapp.Application.Selection.range,10,6) '插入表格 10行6列
tabCurrent.Rows(1).Cells(1).Range.InsertAfter("ZZZZZZZZZZZZZZZZZZZZZZZ")
tabCurrent.style="网格型"
tabCurrent.TopPadding = 0
tabCurrent.BottomPadding = 0
tabCurrent.LeftPadding = 0
tabCurrent.RightPadding =0
tabCurrent.Spacing = 0
tabCurrent.AllowPageBreaks = True
tabCurrent.AllowAutoFit = True
tabCurrent.Borders.InsideColor = wdColorRed
tabCurrent.Borders.OutsideColor = wdColorRed
tabCurrent.Borders.Enable = true
将边框线换颜色也没有效果
...全文
764 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
lhb2000 2018-03-07
  • 打赏
  • 举报
回复
tabCurrent.Select With oapp.Application.Selection.ParagraphFormat .SpaceBeforeAuto = False .SpaceAfterAuto = False .LineSpacingRule = wdLineSpaceExactly .LineSpacing = 12 .WordWrap = True End With With tabCurrent With .Borders(-2) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth150pt .Color = wdColorRed 'wdColorAutomatic End With With .Borders(-4) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth150pt .Color =wdColorRed ' wdColorAutomatic End With With .Borders(-1) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth150pt .Color = wdColorAutomatic End With With .Borders(-3) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth150pt .Color = wdColorAutomatic End With With .Borders(-5) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth075pt .Color = wdColorAutomatic End With With .Borders(-6) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth075pt .Color = wdColorAutomatic End With .Borders(-7).LineStyle = wdLineStyleNone .Borders(-8).LineStyle = wdLineStyleNone .Borders.Shadow = False end With tabCurrent.Borders.Enable = True 我增加这些代码,从录制的宏来的,执行起来不报错,也没有任何变化。
Dogfish 2018-03-07
  • 打赏
  • 举报
回复
https://msdn.microsoft.com/en-us/vba/word-vba/articles/table-borders-property-word 楼主看看这个链接是否有帮助?
lhb2000 2018-03-06
  • 打赏
  • 举报
回复
有人知道吗?

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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