Hi help reg macros

  • Thread starter Thread starter Kadi
  • Start date Start date
K

Kadi

Dear all,
Is it possible to select only the highlighted information from a word
doc to another??
If it requires a small program to be written like macros.

any suggestions and clues are welcomed.

have a gr8 week

Thanks in advance,
bye
kadi
 
Do you mean highlighted as in 'selected' or highlighted as in formatted with
a coloured highlight?
In the case of the former simply copy and paste to a new document
In the case of the latter, tell us a bit more about the document and how you
want the information presenting.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
Hi Mayor,
That was quick reply, Thanks.

leme explain what i want.

I am reading the article written in word document (50 pages)
while reading i highlight few sentences, be selecting clicking the
highlight icon.
those are important ones.
now after reading 50 pages, i would highlighted around 2 pages of
useful things.
which would be sufficient for me to consider that as notes and keep it
safe and brief.

for this reason, i would like to have some macros or easy way to
select only the highlighthed senetces from the 50 pages document and
save it in different document file.

I hope i am clear now.
Can you help me ?

Thanks in advance,
bye
Kadi
 
Hi,

This is for Word 2003.

You could use the Find option. In the Find and Replace dialog box, click
More. Click Format, then click Highlight. This means you are searching for
all text that is highlighted.

Select 'Highlight all items found in'. Click Find All. This selects all text
that is highlighted. Now, sim ply copy and paste.
 
The following macro - http://www.gmayor.com/installing_macro.htm - will
extract all highlighted text to a new document, each on a separate line and
separated by highlight colour.

Sub ExtractHiLight()
Dim FirstFind As Boolean
Dim rDcm As Range
Dim lClr As Long ' color index
Dim sCol As String
Dim Doc1 As Document
Dim Doc2 As Document
If ActiveDocument.Content.HighlightColorIndex <> 0 Then
Set Doc1 = ActiveDocument
Set Doc2 = Documents.Add
Doc1.Activate
For lClr = 1 To 16
FirstFind = True
Select Case lClr
Case 1
sCol = "Black"
Case 2
sCol = "Blue"
Case 3
sCol = "Turquoise"
Case 4
sCol = "Bright green"
Case 5
sCol = "Pink"
Case 6
sCol = "Red"
Case 7
sCol = "Yellow"
Case 8
sCol = "White"
Case 9
sCol = "Dark blue"
Case 10
sCol = "Teal"
Case 11
sCol = "Green"
Case 12
sCol = "Violet"
Case 13
sCol = "Dark red"
Case 14
sCol = "Dark yellow"
Case 15
sCol = "50% gray"
Case 16
sCol = "25% gray"
End Select


Set rDcm = Doc1.Range
With rDcm.Find
.Highlight = True
While .Execute
If rDcm.HighlightColorIndex = lClr Then
If FirstFind Then
Doc2.Range.InsertAfter sCol & vbCr
FirstFind = False
End If
Doc2.Range.InsertAfter vbTab & rDcm.Text & vbCr
End If
Wend
End With
Next
Else
MsgBox "No Highlighting found."
End If
End Sub

If you are not bothered about the colours, you can simplify that to

Sub ExtractHiLight()
Dim rDcm As Range
Dim lClr As Long ' color index
Dim Doc1 As Document
Dim Doc2 As Document
If ActiveDocument.Content.HighlightColorIndex <> 0 Then
Set Doc1 = ActiveDocument
Set Doc2 = Documents.Add
Doc1.Activate
Set rDcm = Doc1.Range
With rDcm.Find
.Highlight = True
While .Execute
Doc2.Range.InsertAfter rDcm.Text & vbCr
Wend
End With
Else
MsgBox "No Highlighting found."
End If
End Sub


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
Dear All ,
Thank you so much for so instant repliess and solutions.
I am happy , i will try out immediately, if any problems shall come
again.
Thanks again

sincerely,
Karthick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top