Index of all words used in MS Word document -
i need create index @ end of ms word document lists words used in document, page number there used in alphabetical order. can built in index capabilities? if how go doing this? or need macro, , if can me script?
this takes ever on large documents generate index fields need create index in word document. after macro has run can references > insert index
have actual index in document.
dim colwords collection set colwords = new colection 'add words don't want index colwords.add "and" colwords.add "you" dim wrd range each wrd in activedocument.words 'only if have 3 chars index if len(trim(wrd.text)) > 2 ' prevent field being indexed well... dim infield boolean infield = false dim fld field each fld in activedocument.fields if (wrd.start >= fld.code.start , wrd.end <= fld.code.end) infield = true exit 'break out end if next if (not infield) ' check if indexed? dim findword string findword = lcase(wrd.text) each cached in colwords if cached = findword infield = true exit 'break out end if next if (not infield) activedocument.indexes.markallentries range:=wrd, entry:=wrd.text, _ entryautotext:=wrd.text, crossreference:="", crossreferenceautotext:="", _ bookmarkname:="", bold:=false, italic:=false colwords.add findword end if end if end if next
Comments
Post a Comment