Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Closed Thread
 
Thread Tools Display Modes
  #1  
Old 04-09-2022, 05:24 AM
reene11 reene11 is offline How to generate an open items list automatically? Windows 10 How to generate an open items list automatically? Office 2019
Banned
How to generate an open items list automatically?
 
Join Date: Apr 2022
Posts: 1
reene11 is on a distinguished road
Default How to generate an open items list automatically?


At my previous employer, word had a tool where you could have it automatically generate a new word document that would list out all language/text that was in between open and closed brackets.

So, instead of having to go through the doc, bracket by bracket, it would auto pull them into a list for easy tracking. The thing is, I cannot find any resource online for this, and was hoping someone on Reddit is familiar with a word tool that does similar stuff.
  #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: 21,963
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]
Closed Thread



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 10:46 AM.


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