Sub ProcessSelectedColumn()
Dim oTbl As Table
Dim oCell As cell
Dim iRow As Integer
Dim iCol As Integer
Dim oRange As Range
' 检查是否有表格被选中
If Selection.Information(wdWithInTable) Then
' 获取包含所选内容的表格
Set oTbl = Selection.Tables(1)
' 遍历选定列的每个单元格
For iRow = 1 To oTbl.Rows.Count
Set oCell = oTbl.cell(iRow, 2)
ActiveDocument.Indexes.MarkEntry Range:=oCell.Range, Entry:=oCell.Range.Text
Next iRow
Else
MsgBox "没有选中表格或表格中的单元格。"
End If
End Sub