0

我试图弄清楚是否可以将 MS Word VB 中的范围变量的范围设置为 MS Word 文档中第三个表的第三列的应用程序。

到目前为止,这是在不破坏代码的情况下尽可能接近的:

Set range = ActiveDocument.Tables(3).range

有什么方法可以让我在其中引用 Columns(3) 而不会让调试器发疯?

到目前为止我的代码:

Set range = ActiveDocument.Tables(3).range
With range.Find
    .Text = "Passed"
    .Format = True 
    .MatchCase = True
    .MatchWholeWord = False
    .MatchWildcards = False
    .MatchSoundsLike = False
    .MatchAllWordForms = False
    Do While .Execute(Forward:=True) = True
        iCount = iCount + 1
    Loop
End With
4

1 回答 1

0

就像是 ... ?

Dim col As Column
Set col = ActiveDocument.Tables(3).Columns(3)
col.Cells(1).Range.Text = "Abc"
Debug.Print col.Cells(1).Range.Text
于 2012-11-20T21:30:08.183 回答