View Single Post
 
Old 07-26-2023, 07:13 PM
Journeyman Journeyman is offline Windows 10 Office 2019
Novice
 
Join Date: Feb 2023
Posts: 15
Journeyman is on a distinguished road
Default

This is a very easy method to find highlighted text in your word document

Code:
Sub Runme()
'Note that this code is written into a word VBE. You could just as easy write something similar into excel.

Dim w As Variant
    For Each sentence In ActiveDocument.StoryRanges
        For Each w In sentence.Words
             'Returns a bolded word
            If w.Font.Bold = True Then Debug.Print "Bold: " & w
             'Returns a highlighted word
            If w.HighlightColorIndex > 0 Then Debug.Print "Hightlight: " & w
        Next
    Next
End Sub
I previously replied to another post today, which will explain how to copy text into an excel file. The post is written for excel, and is for code run in excel, but will give you a good idea how to copy information from Word into Excel:

https://www.msofficeforums.com/word-...text-word.html

Give it a go and see where you end up.
Reply With Quote