Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 06-19-2017, 01:06 PM
slaycock slaycock is offline Word VBA to search for bold text within a table Windows 7 64bit Word VBA to search for bold text within a table Office 2013
Expert
 
Join Date: Sep 2013
Posts: 255
slaycock is on a distinguished road
Default

Quote:
1. If bold text is not found within a row, then it moves onto the next row.
2. If bold text is found, the code checks it against a predefined list of names.
3. If the bold text is within the predefined list of names, then it moves into the next row.
4. If the bold text is not in the list of predefined names, then the program checks to see if bold text with the predefined names appears after the non-predefined bold text.
5. If bold text does not appear after the non-predefined bold text, then it selects and copies everything from the beginning of the bold text to the end of the table.
6. If bold text with one of the predefined names appears after the non-predefined bold text, then the program would preferably select and copy all the rows in between the two bold rows (including the row with the non-predefined bold text), or else return a msg box that says something along the lines of "there is an extra category within the document".
You are trying to describe an algorithm rather than what you want to happen.

1. Check
2. Check Your predefined list of names is the string assigned to myKeyTerms
3. At the moment we continue searching the row
4. You now need a flag to say you found bold text but it wasn't a key term
5. OK if the bold text isn't a key term we copy something. Do you really mean end of table or end of row?
6 now you are losing me.

Code:
 Could you give me a bit more background on the logical/technical errors that are within my code (for future reference)?
There would be a lot of comments. I don't want to be rude but the main problem is that you don't really seem to have a grasp of VBA and the Word object model.

The best recommendation would be to get yourself a good book on VBA and start reading.
Reply With Quote
 

Tags
search rows



Similar Threads
Thread Thread Starter Forum Replies Last Post
Word VBA to search for bold text within a table VBA Table – Search All Tables - Find & Replace Text in Table Cell With Specific Background Color jc491 Word VBA 8 09-30-2015 06:10 AM
Word VBA to search for bold text within a table Text in #1 is made bold, rest of the document is edited, text in #1 is now not bold footer-assistance Word 1 06-29-2015 03:49 AM
VBA Search Table for Text/Select Text/Insert Hyperlink sldrellich Word VBA 3 03-24-2015 01:09 PM
how to search and replace BOLD text >> font color change? dylansmith Word 4 03-12-2013 09:51 PM
Word VBA to search for bold text within a table exporting bold text from excel to word? stella@happisburgh.net Excel 3 12-05-2010 08:03 AM

Other Forums: Access Forums

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