word vba的代码,设置边框的,在2003里面能够正常使用,如下:
With Selection.Cells
.Borders(wdBorderLeft).LineStyle = wdLineStyleNone
With .Borders(wdBorderRight)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth050pt
.Color = wdColorAutomatic
End With
With .Borders(wdBorderTop)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth050pt
.Color = wdColorAutomatic
End With
With .Borders(wdBorderBottom)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth050pt
.Color = wdColorAutomatic
End With
.Borders(wdBorderDiagonalDown).LineStyle = wdLineStyleNone
.Borders(wdBorderDiagonalUp).LineStyle = wdLineStyleNone
.Borders.Shadow = False
End With
,在word2007中出现错误,错误提示为: 集合所要求的成员不存在,发生错误的地点就在
.Borders(wdBorderDiagonalDown).LineStyle = wdLineStyleNone
.Borders(wdBorderDiagonalUp).LineStyle = wdLineStyleNone这两行,有大神能帮忙解答一下吗?应该如何修改?
整个过程前面是这样的:
Dim ta As Table
Set ta = Tables(3)
ta.Cell(ta.Rows.Count, 1).Select
Selection.InsertRowsBelow 1
Set ta = Tables(3)
ta.Cell(Row, 1).Select
+边框设置,
这样写对象成员有问题吗?