2012-11-20 68 views
0

我想弄清楚我是否可以将MS Word VB中的范围变量的范围设置为MS中第三个表的第三列的第三列Word文档。如何识别MS Word宏的第三个表的第三列

到目前为止,这是接近我可以没有我的密码破译得到:

Set range = ActiveDocument.Tables(3).range 

有什么办法,我把在分列参考(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 

回答

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 
+0

感谢您的建议。但是,我如何使细胞(1)动态?换句话说,使得范围不限于第三列中的第一个单元格,而是列中的所有单元格? –

+0

'For Each c col.Cells'将是单向的。 – Fionnuala

相关问题