View Single Post
 
Old 04-23-2019, 03:52 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 Copy contents between parenthesis and paste to end of document

I found this code which will show me everything in the word document found between parenthesis. It shows in the Msgbox, but instead I would like to see the contents at the end of my document.

Code:
Sub FindInsideParanthesis()

    Dim myrange
    Set myrange = Application.ActiveDocument.Content

    Dim myFind
    Set myFind = myrange.Find

    While (myFind.Execute(FindText:="\(*\)", MatchWildcards:=True))

        'Process your tag here
        MsgBox (myrange.Text)

    Wend

End Sub
Reply With Quote