Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 04-09-2022, 07:42 AM
macropod's Avatar
macropod macropod is offline How to generate an open items list automatically? Windows 10 How to generate an open items list automatically? Office 2016
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

Quote:
Originally Posted by reene11 View Post
I cannot find any resource online for this, and was hoping someone on Reddit is familiar with a word tool that does similar stuff.
This site has no connection to Reddit.

For the problem you've described, and assuming your 'brackets' are parentheses, try:
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim Rng As Range, StrOut As String
With ActiveDocument.Range
  With .Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = "\(*\)"
    .Replacement.Text = ""
    .Forward = True
    .Wrap = wdFindStop
    .Format = False
    .MatchWildcards = True
  End With
  Do While .Find.Execute
    With .Duplicate
      Set Rng = .Characters.Last
      Do While InStr(2, .Text, "(", vbTextCompare) > 0
        .MoveEndUntil ")", wdForward
        .End = .End + 1
        .Start = .Start + 1
        .MoveStartUntil "(", wdForward
        Set Rng = .Characters.Last
      Loop
    End With
    .End = Rng.End
    StrOut = StrOut & vbCr & .Text
    .Collapse wdCollapseEnd
  Loop
End With
Documents.Add
ActiveDocument.Range.InsertAfter StrOut
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA or Macros to generate List asante_za Excel Programming 1 09-29-2017 09:51 AM
Automatically generate formulas from just the row numbers (auto insert the column) knewman Excel 14 04-25-2017 11:54 PM
How to generate an open items list automatically? List of 30 items with Logos, transition the 30 items blexann PowerPoint 1 11-03-2016 08:55 AM
How to generate an open items list automatically? Automatically generate PDF from saved word doc JamesHusband Word 3 06-07-2014 08:30 AM
Outlook 2007 Saved sent items list only holds the last ten items david.peake Outlook 0 06-01-2010 07:27 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:27 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