Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.
Selection.TypeText ("(" & Abbreviation & " placeholder )")

IndexEntryRange = ActiveDocument.Indexes.MarkEntry(Range:=Selection.Range, Entry:=Abbreviation, CrossReference:=Definition, CrossReferenceAutoText:="", BookmarkName:="", Bold:=False, Italic:=False)

Is it possible to insert IndexEntryRange at the placeholder position?

share|improve this question
1  
Do you mean insert the XE field before the "placeholder" text? –  Adam Dec 10 '12 at 22:36
    
Hi Adam. No, I want the "placeholder" text to be substituted with the XE field which is the IndexEntryRange. As a final result the output in Word should be (Abbreviation({ XE "Abbreviation" \t "Definition" }). As such it should sit between the () brackets. Does that make it clear? Regards, Robert –  orschiro Dec 11 '12 at 4:40

1 Answer 1

up vote 1 down vote accepted

If I understand correctly from the code you posted it might be easier to insert the index directly into position instead of replacing the placeholder text.

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 (" )")
share|improve this answer
    
Thank you Adam, exactly what I was looking for! –  orschiro Dec 15 '12 at 9:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.