Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-21-2024, 09:21 PM
tonykekw tonykekw is offline Finding,Sorting and creating a new Section VBA Script help Windows 11 Finding,Sorting and creating a new Section VBA Script help Office 2021
Novice
Finding,Sorting and creating a new Section VBA Script help
 
Join Date: Jan 2024
Posts: 13
tonykekw is on a distinguished road
Unhappy Finding,Sorting and creating a new Section VBA Script help

Hello again, I have a new question, and I haven't found something similar to my problem at hand yet.



What I would like to do is find a value (for e.g., [red]) within my document. Just how the built-in Navigation pane does. This is because I have many "tags" at the end of sentences and/or paragraphs that end with such "tags".

Then I would like to essentially grab the entire sentence/paragraph that comes before the "tags" along with the tag itself.

For example, Adam ate an apple.[Red]

I look up the "tag" [Red], and I pull that entire sentence before it along with the tag.

If possible, I would also like to have the heading level name with it. The document uses many of the MS Word built-in heading levels to organize the document.

I have managed to write some scripts that try to do what I want, but they time out or I have an error.

The reason I would like to do this is so that the reader can only read what they want to read. Such as if they only want to read the tag [blue] or #triangle. They can just click on a section of the document that says "[blue] documentation.

I know this is confusing and very long and specific, but I have been working on trying to figure this one out myself for about a month before asking for help. I would provide my code snippets, but they don't work, and I did use ChatGPT to help me with them. Save myself the embarrassment.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with creating a script with VBA lenziwag93 Excel Programming 1 04-20-2022 12:57 AM
Need Help to Script to align all the tables only as of a section to end of doc? Cendrinne Word VBA 4 04-05-2021 11:37 AM
Creating a master spreadsheet for sorting information Notsonerdy Excel Programming 8 05-31-2016 04:39 AM
Creating a list and sorting alphabetically. irvsax Word 4 09-04-2013 11:47 PM
Finding,Sorting and creating a new Section VBA Script help Creating a sorting method. Balliol Word 2 07-25-2013 06:18 AM

Other Forums: Access Forums

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