Selection.TypeText ("(" & Abbreviation & " placeholder )")
IndexEntryRange = ActiveDocument.Indexes.MarkEntry(Range:=Selection.Range, Entry:=Abbreviation, CrossReference:=Definition, CrossReferenceAutoText:="", BookmarkName:="", Bold:=False, Italic:=False)
可以IndexEntryRange
在该placeholder
位置插入吗?
答案1
如果我正确理解您发布的代码,将索引直接插入到位置可能比替换占位符文本更容易。
Selection.TypeText ("(" & Abbreviation)
IndexEntryRange = ActiveDocument.Indexes.MarkEntry(Range:=Selection.Range, Entry:=Abbreviation, CrossReference:=Definition, CrossReferenceAutoText:="", BookmarkName:="", Bold:=False, Italic:=False)
Selection.MoveEnd
Selection.MoveRight
Selection.TypeText (" )")