簡體   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