View Single Post
 
Old 04-24-2019, 04:01 PM
jeffreybrown jeffreybrown is offline Windows Vista Office 2007
Expert
 
Join Date: Apr 2016
Posts: 673
jeffreybrown has a spectacular aura aboutjeffreybrown has a spectacular aura about
Default Create bookmarks, links, or references throught doc

What is the best way to create bookmarks, links, or references throughout a doc?

I have some VBA to extract the references throughout the document that I would like to reference.

Code:
Sub FindInsideParanthesis()
    Dim StrOut As String
    With ActiveDocument
      With .Range
        With .Find
          .Text = "\(*\)"
          .MatchWildcards = True
          .Execute
        End With
        Do While .Find.Found = True
          StrOut = StrOut & vbCr & .Text
          .Collapse wdCollapseEnd
          .Find.Execute
        Loop
      End With
      .Range.InsertAfter StrOut
    End With
End Sub
This will place the references at the end of the document with the parenthesis attached, but I will remove the parenthesis first. I manual setup some examples in this document, but would like to automate this process.
Attached Files
File Type: docx Test Doc.docx (17.5 KB, 10 views)
Reply With Quote