0
我有一個定義的索引:使用.Selection或變量在索引中工作?
超人 - 指的是真正的超級花花公子
氪石 - 意味着什麼超人不喜歡
等
我想通過每個Paragraph
環路(自條目由「Enter」分隔)索引中,並從其起始處加下劃線,直到-
。
但是,我無法弄清楚如何使用索引。我可以更新索引(ActiveDocument.Indexes(1).Update
),但無法弄清楚如何使用索引。在numParas
線
Sub underline_Index_Definitions()
Dim myDoc As Word.Document
Dim numParas&
Dim rng As Word.Range
Set myDoc = ActiveDocument
Debug.Print "You have : " & myDoc.Indexes.Count & " indexes."
numParas = myDoc.Indexes(1).Paragraphs.Count
For Each par In Indexes(1)
'Select the text from the start, until a dash
' blah blah blah
Next par
End With
End Sub
不過,當然,它的錯誤了,因爲我不能做到這一點:我想是這樣的。我也做不到myDoc.Indexes(1).Select // With Selection ...
謝謝!之間的'.Range'是我錯過的。非常感激! – BruceWayne