office365,循环“l in lines”最后一个数据是 nothing。好像在所有文本内容的最后面还有有一行 nothing,就导致了 字体颜色 设置的错误,该属性无法作用于那个对象
![]() ![]() 打卡Lv3
|
马作德1208
展开
|
![]() ![]() 学习达人
|
苦涩的酒
展开
|
![]() ![]() 学习达人
|
najieguo
展开
老师这段代码不能用,报错,是什么原因
Sub test1()
Dim rec As Rectangle, l As Line, intNum As Integer
On Error GoTo 100
For Each rec In ThisDocument.Windows(1).Panes(1).Pages(2).Selection.ShapeRange(1)
For Each l In rec.Lines
intNum = intNum + 1
If intNum Mod 2 Then
l.Range.Font.ColorIndex = wdBlue
End If
Next
Next |
承担因您的行为而导致的法律责任,
本站有权保留或删除有争议评论。
参与本评论即表明您已经阅读并接受
上述条款。