Microsoft Office Forums

Go Back   Microsoft Office Forums > Microsoft Word > Word

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 08-11-2018, 09:27 AM
angiesnow angiesnow is offline Mac OS X Office 2016 for Mac
Novice
 
Join Date: Aug 2018
Posts: 2
angiesnow is on a distinguished road
Default Is this even possible: extrapolating highlighted words

Hi everyone,



I've been trying to find out Online whether or not Word has this capability, perhaps I'm not wording it right because I can't seem to find anything. If anyone knows, you guys will! Here's my situation:

I am using Word to write pages and pages of notes for my coursework. I am constantly highlighting certain key terms and phrases that I need to study and/or memorize later. Is there any way I could somehow command Word to extrapolate from my notes only the words that are highlighted (or marked in some way)? that way I could quickly create a list of just those words/terms that I need to study. For example, if I bold those words, can I later command Word to take all words that are bold and copy them to the clipboard or something like that so that I can paste them somewhere else? What do you guys think?

Thanks!
Reply With Quote
  #2  
Old 08-11-2018, 08:38 PM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 2,564
gmayor is a jewel in the roughgmayor is a jewel in the roughgmayor is a jewel in the roughgmayor is a jewel in the rough
Default

The following macro will put all the unique highlighted words or phrases into a new document each to a new line:
Code:
Sub ExtractWords()
Dim oDoc As Document
Dim oSource As Document
Dim oRng As Range
Dim Coll As Collection
Dim i As Long
    Set oSource = ActiveDocument
    Set oRng = oSource.Range
    Set Coll = New Collection
    With oRng.Find
        .Highlight = True
        Do While .Execute
            On Error Resume Next
            Coll.Add oRng.Text, oRng.Text
            oRng.Collapse 0
        Loop
    End With
    If Coll.Count > 0 Then
        Set oDoc = Documents.Add
        For i = 1 To Coll.Count
            oDoc.Range.InsertAfter Coll(i) & vbCr
        Next i
    End If
lbl_Exit:
    Set oDoc = Nothing
    Set oSource = Nothing
    Set oRng = Nothing
    Set Coll = Nothing
    Exit Sub
End Sub
http://www.gmayor.com/installing_macro.htm
__________________
Graham Mayor - MS MVP (Word)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 08-12-2018, 03:40 AM
angiesnow angiesnow is offline Mac OS X Office 2016 for Mac
Novice
 
Join Date: Aug 2018
Posts: 2
angiesnow is on a distinguished road
Default

Wow, thank you so much! Works like a charm. I really appreciate the help.

Cheers!
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to find (highlight) two and more words in a list of 75k single words in Word 2010 Usora Word 8 05-29-2018 03:34 AM
VBA Find&Replace all bold, itlaic, underlined and highlighted words/characters Kalü Word VBA 22 04-24-2018 05:35 AM
Highlighted folders grjbyfleet Outlook 0 06-03-2017 01:07 AM
How to mark underlined words in a sentence as A, B, C, D (beneath the words) thudangky Word 13 12-12-2013 02:22 AM
Why Words doesn’t show the style of the selected words automatically???? Jamal NUMAN Word 0 04-14-2011 03:20 PM


All times are GMT -7. The time now is 01:21 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
MSOfficeForums.com is not affiliated with Microsoft