Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-11-2018, 09:27 AM
angiesnow angiesnow is offline Is this even possible: extrapolating highlighted words Mac OS X Is this even possible: extrapolating highlighted words Office 2016 for Mac
Novice
Is this even possible: extrapolating highlighted words
 
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 Is this even possible: extrapolating highlighted words Windows 10 Is this even possible: extrapolating highlighted words Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
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) (2002-2019)
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 Is this even possible: extrapolating highlighted words Mac OS X Is this even possible: extrapolating highlighted words Office 2016 for Mac
Novice
Is this even possible: extrapolating highlighted words
 
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
Is this even possible: extrapolating highlighted words 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
Is this even possible: extrapolating highlighted words 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

Other Forums: Access Forums

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