繁体   English   中英

如何为MS Word宏识别第三张表的第三列

[英]How to identify the third column of the third table for MS Word macro

我试图弄清楚是否可以在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

就像是 ... ?

Dim col As Column
Set col = ActiveDocument.Tables(3).Columns(3)
col.Cells(1).Range.Text = "Abc"
Debug.Print col.Cells(1).Range.Text

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM