Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
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
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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .