MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.
Option Explicit Sub CreateAutoMarkFile() Dim fld As Field Dim strText As String Dim rw As Row Dim tbl As Table Dim bFound As Boolean Dim doc As Word.Document Dim DocA As Document Set DocA = ActiveDocument Set doc = Documents.Add Set tbl = doc.Tables.Add(doc.Range, 1, 2) For Each fld In DocA.Fields If fld.Type = wdFieldIndexEntry Then strText = GetIndexText(fld) bFound = False For Each rw In tbl.Rows If GetCellText(rw.Cells(1)) = strText Then bFound = True Exit For End If Next rw If Not bFound Then If Len(tbl.Rows.Last.Range) = 6 Then Set rw = tbl.Rows.Last Else Set rw = tbl.Rows.Add End If rw.Cells(1).Range.Text = strText rw.Cells(2).Range.Text = strText End If End If Next fld End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|How Resolve Word 2011 Office-Database Error in Mac OS X||10||125|
|Office 365 - Recent Documents lost after subscription renew||20||86|
|microsoft word document highlighting a screenshot||8||154|
|Word 2016 Workgroup Template GPO not applying.||6||54|
Join the community of 500,000 technology professionals and ask your questions.