Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 04-23-2019, 05:14 PM
macropod's Avatar
macropod macropod is offline Copy contents between parenthesis and paste to end of document Windows 7 64bit Copy contents between parenthesis and paste to end of document Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,360
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

Try:
Code:
Sub FindInsideParanthesis()
Dim StrOut As String
With ActiveDocument
  With .Range
    With .Find
      .Text = "\(*\)"
      .MatchWildcards = True
      .Execute
    End With
    Do While .Find.Found = True
      'The next two lines exclude the start/end characters from what gets processed
      .Start = .Start + 1
      .End = .End - 1
      StrOut = StrOut & vbCr & .Text
      .Collapse wdCollapseEnd
      .Find.Execute
    Loop
  End With
  .Range.InsertAfter StrOut
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Font changes when I copy/paste one document into another RobertWA Word 3 03-25-2019 06:13 AM
Is it possible to copy & paste Table of Contents out of one document into another? mikey386 Word 4 12-18-2014 08:45 AM
Copy contents between parenthesis and paste to end of document Problem with saving document after paste some contents from another document expert4knowledge Word 3 11-26-2013 03:53 AM
copy from web and paste in a word document : no images are shown Ron Wolpa Word 5 09-11-2013 02:16 AM
Copy the contents of a dcoument and paste it several times in a new document Gerjanst Word VBA 0 06-30-2010 12:51 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:08 AM.


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