Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
David Newmarch David Newmarch is offline
external usenet poster
 
Posts: 45
Default macro to extract multiple text selections

I want to be able to extract a whole lot of highlighted words and phrases
from a long Word document and copy them as a list to a new document.

One solution seems to be to use Spike, and I've recorded the following macro
(which I've called "multispike") to copy each highlighted word/phrase to
Spike. Where I need help, please, is with getting this macro to loop so that
it will run through the whole document.

Sub multispike()
'
' multispike Macro
' Macro recorded 23/04/2007 by dn
'
Selection.Find.ClearFormatting
Selection.Find.Highlight = True
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
NormalTemplate.AutoTextEntries.AppendToSpike Range:=Selection.Range
End Sub

And I'm also unsure how many selections Spike can handle. Is it feasible to
even attempt this method with a really long document (more than 200 pages,
with several hundred highlighted bits of text that I'm trying to extract)?
The document (a book manuscript) consists of about a dozen chapters and I can
always repeat the operation one chapter at a time, but it would be more
convenient to do the whole job at once.

And maybe there's a better way to approach the whole task. Any suggestions
will be most gratefully received.


  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Beth Melton Beth Melton is offline
external usenet poster
 
Posts: 1,380
Default macro to extract multiple text selections

What version of Word are you using? As of Word 2002 you can use
noncontiguous text selection. Then all you need to do in Find is use "Find
All" and then copy/paste the found results as desired.

Please post all follow-up questions to the newsgroup. Requests for
assistance by email can not be acknowledged.

~~~~~~~~~~~~~~~
Beth Melton
Microsoft Office MVP

Co-author of Word 2007 Inside Out:
http://www.microsoft.com/MSPress/boo...x#AboutTheBook

Word FAQ: http://mvps.org/word
TechTrax eZine: http://mousetrax.com/techtrax/
MVP FAQ site: http://mvps.org/

"David Newmarch" wrote in message
...
I want to be able to extract a whole lot of highlighted words and phrases
from a long Word document and copy them as a list to a new document.

One solution seems to be to use Spike, and I've recorded the following
macro
(which I've called "multispike") to copy each highlighted word/phrase to
Spike. Where I need help, please, is with getting this macro to loop so
that
it will run through the whole document.

Sub multispike()
'
' multispike Macro
' Macro recorded 23/04/2007 by dn
'
Selection.Find.ClearFormatting
Selection.Find.Highlight = True
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
NormalTemplate.AutoTextEntries.AppendToSpike Range:=Selection.Range
End Sub

And I'm also unsure how many selections Spike can handle. Is it feasible
to
even attempt this method with a really long document (more than 200 pages,
with several hundred highlighted bits of text that I'm trying to extract)?
The document (a book manuscript) consists of about a dozen chapters and I
can
always repeat the operation one chapter at a time, but it would be more
convenient to do the whole job at once.

And maybe there's a better way to approach the whole task. Any suggestions
will be most gratefully received.




  #3   Report Post  
Posted to microsoft.public.word.docmanagement
David Newmarch David Newmarch is offline
external usenet poster
 
Posts: 45
Default macro to extract multiple text selections

Many thanks Beth. That does exactly what I wanted. Now my only problem is
trying to figure out what I did wrong when I tried that out to begin with!

"Beth Melton" wrote:

What version of Word are you using? As of Word 2002 you can use
noncontiguous text selection. Then all you need to do in Find is use "Find
All" and then copy/paste the found results as desired.

Please post all follow-up questions to the newsgroup. Requests for
assistance by email can not be acknowledged.

~~~~~~~~~~~~~~~
Beth Melton
Microsoft Office MVP

Co-author of Word 2007 Inside Out:
http://www.microsoft.com/MSPress/boo...x#AboutTheBook

Word FAQ: http://mvps.org/word
TechTrax eZine: http://mousetrax.com/techtrax/
MVP FAQ site: http://mvps.org/

"David Newmarch" wrote in message
...
I want to be able to extract a whole lot of highlighted words and phrases
from a long Word document and copy them as a list to a new document.

One solution seems to be to use Spike, and I've recorded the following
macro
(which I've called "multispike") to copy each highlighted word/phrase to
Spike. Where I need help, please, is with getting this macro to loop so
that
it will run through the whole document.

Sub multispike()
'
' multispike Macro
' Macro recorded 23/04/2007 by dn
'
Selection.Find.ClearFormatting
Selection.Find.Highlight = True
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
NormalTemplate.AutoTextEntries.AppendToSpike Range:=Selection.Range
End Sub

And I'm also unsure how many selections Spike can handle. Is it feasible
to
even attempt this method with a really long document (more than 200 pages,
with several hundred highlighted bits of text that I'm trying to extract)?
The document (a book manuscript) consists of about a dozen chapters and I
can
always repeat the operation one chapter at a time, but it would be more
convenient to do the whole job at once.

And maybe there's a better way to approach the whole task. Any suggestions
will be most gratefully received.





  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Beth Melton Beth Melton is offline
external usenet poster
 
Posts: 1,380
Default macro to extract multiple text selections

Glad to hear the solution will work for you. :-)

For some reason, sometimes what it takes is confirmation that what you
thought should work actually does work. ;-)

Please post all follow-up questions to the newsgroup. Requests for
assistance by email can not be acknowledged.

~~~~~~~~~~~~~~~
Beth Melton
Microsoft Office MVP

Co-author of Word 2007 Inside Out:
http://www.microsoft.com/MSPress/boo...x#AboutTheBook

Word FAQ: http://mvps.org/word
TechTrax eZine: http://mousetrax.com/techtrax/
MVP FAQ site: http://mvps.org/

"David Newmarch" wrote in message
...
Many thanks Beth. That does exactly what I wanted. Now my only problem is
trying to figure out what I did wrong when I tried that out to begin with!

"Beth Melton" wrote:

What version of Word are you using? As of Word 2002 you can use
noncontiguous text selection. Then all you need to do in Find is use
"Find
All" and then copy/paste the found results as desired.

Please post all follow-up questions to the newsgroup. Requests for
assistance by email can not be acknowledged.

~~~~~~~~~~~~~~~
Beth Melton
Microsoft Office MVP

Co-author of Word 2007 Inside Out:
http://www.microsoft.com/MSPress/boo...x#AboutTheBook

Word FAQ: http://mvps.org/word
TechTrax eZine: http://mousetrax.com/techtrax/
MVP FAQ site: http://mvps.org/

"David Newmarch" wrote in
message
...
I want to be able to extract a whole lot of highlighted words and
phrases
from a long Word document and copy them as a list to a new document.

One solution seems to be to use Spike, and I've recorded the following
macro
(which I've called "multispike") to copy each highlighted word/phrase
to
Spike. Where I need help, please, is with getting this macro to loop so
that
it will run through the whole document.

Sub multispike()
'
' multispike Macro
' Macro recorded 23/04/2007 by dn
'
Selection.Find.ClearFormatting
Selection.Find.Highlight = True
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
NormalTemplate.AutoTextEntries.AppendToSpike Range:=Selection.Range
End Sub

And I'm also unsure how many selections Spike can handle. Is it
feasible
to
even attempt this method with a really long document (more than 200
pages,
with several hundred highlighted bits of text that I'm trying to
extract)?
The document (a book manuscript) consists of about a dozen chapters and
I
can
always repeat the operation one chapter at a time, but it would be more
convenient to do the whole job at once.

And maybe there's a better way to approach the whole task. Any
suggestions
will be most gratefully received.







Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
extract data from multiple Word forms into Excel bbbitt Microsoft Word Help 6 October 18th 07 01:08 PM
extract data from multiple word forms into excel (revisited) kyle Microsoft Word Help 3 August 17th 06 02:41 PM
Multiple selections in a form field drop-down list Ms.D Microsoft Word Help 1 July 12th 06 05:40 PM
How can I allow multiple selections in a drop down box? Barbie Microsoft Word Help 1 February 23rd 06 03:29 PM
multiple option button selections questions Microsoft Word Help 1 February 15th 05 05:57 PM


All times are GMT +1. The time now is 05:18 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"