以下是引用hpw在2004-11-2 17:29:00的发言:
我的代码是这样滴,但不能执行,请柔MM帮我看看
Dim i As Table
Application.ScreenUpdating = False
For Each i In ActiveDocument
With i.Tables
.Style = "列表型 4"
.ApplyStyleHeadingRows = False
.ApplyStyleLastRow = False
.ApplyStyleFirstColumn = False
.ApplyStyleLastColumn = False
End With
Next
Application.ScreenUpdating = True
请参:
Sub settables()
Dim i As Table
Application.ScreenUpdating = False
For Each i In ActiveDocument.Tables
With i
.Style = "列表型 4"
.ApplyStyleHeadingRows = False
.ApplyStyleLastRow = False
.ApplyStyleFirstColumn = False
.ApplyStyleLastColumn = False
End With
Next
Application.ScreenUpdating = True
End Sub
你的代码中有一个明显的问题,就是集合对象与集合之间没有搞清楚,比如本例,table是每一个表,单张表;而tables则是所有表的集合(前提是活动文档或者指定文档),所以应该是每个表(i)在所有表的集合(tables)中循环. |