Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 04-24-2019, 04:44 PM
macropod's Avatar
macropod macropod is offline Create bookmarks, links, or references throught doc Windows 7 64bit Create bookmarks, links, or references throught doc Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You could, of course use an INDEX, in which case, you'd simply add XE fields at each of the found locations. For example:
Code:
Sub IndexParentheses()
Dim StrIdx As String
With ActiveDocument
  With .Range
    With .Find
      .Text = "\(*\)"
      .MatchWildcards = True
      .Execute
    End With
    Do While .Find.Found = True
      StrIdx = Replace(Replace(.Text, ")", Chr(34)), "(", Chr(34))
      .Collapse wdCollapseEnd
      .Fields.Add .Duplicate, wdFieldEmpty, "XE " & StrIdx, False
      .Find.Execute
    Loop
  End With
    .Indexes.Add Range:=.Range.Characters.Last, HeadingSeparator:=wdHeadingSeparatorNone, _
      Type:=wdIndexIndent, RightAlignPageNumbers:=True, NumberOfColumns:=1
End With
End Sub
No bookmarks or cross-references, per se, needed. The Index entries get sorted alphabetically and, if the same entry appears multiple times, grouped.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Create bookmarks, links, or references throught doc Is there a way to summarise all bookmarks and cross references used in a Word document? Training Word VBA 1 11-09-2017 12:06 AM
Where to put Subroutine to make sure bookmarks aren't deleted so cross-references work mrsjetset Word VBA 5 06-29-2016 05:06 PM
Create bookmarks, links, or references throught doc Bookmarks & cross-references Suchoklates Word 1 09-19-2013 02:32 AM
Links between files to bookmarks in PDF spud098 Word 0 07-14-2010 01:11 AM
Bookmarks with different figure references Dan_68 Word 0 02-15-2010 08:29 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:48 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft