A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Highlighter Or Something Like that :-)



 
 
Thread Tools Display Modes
  #11  
Old April 19th, 2009, 10:44 PM posted to microsoft.public.word.newusers
eman
external usenet poster
 
Posts: 20
Default Highlighter Or Something Like that :-)

I'm not stubborn and you are not helpful

"Suzanne S. Barnhill" wrote in message
...
Are you incapable of scrolling down past the first screen? The article at
http://www.gmayor.com/installing_macro.htm has several sections
specifically devoted to Word 2007. If you are too stubborn to find them,
then you're on your own.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org

"eman" wrote in message
...
Hi Suzanne, you are trying to be smart!!!!!!!!!! The link Graham
suggested is for 2000-2003.
And Suzanne I am not asking you but thanks anyway. What I need is how can
I use the document (or macro) that Graham posted?
Or I have to install Macro first? I am new to this and I am confused.

"Suzanne S. Barnhill" wrote in message
...
I guess it was a complete waste of time for Graham to include the parts
that say, "In Word 2007..."?

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org

"eman" wrote in message
...
It is for Word 2000-2003, I have Word 2007

"Suzanne S. Barnhill" wrote in message
...
Graham provided this information in his initial post:
http://www.gmayor.com/installing_macro.htm

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org

"eman" wrote in message
...
Hi, as I never used maros before, please can you tell me how can I
make use of it?

10X

"Graham Mayor" wrote in message
...
Testing the macro on the 125 pages of subtitles from 'The Godfather
III', the macro takes just over a minute to run through and mark the
whole document. In doing so I came up with a minor refinement which
will allow you to re-mark the document by running the macro again
with a different value for the number of lines. Setting the value to
1 will remove the highlight, though there are much faster ways to
remove the highlight e.g.

Sub RemoveTheHighlight()
ActiveDocument.Range.HighlightColorIndex = wdAuto
End Sub

Revised macro:

Sub HiLightFive()
Dim oRng As Range
Dim oTest As Range
Dim i As Long
Dim iPara As Integer
iPara = InputBox("Highlight how many lines?", _
"Subtitle", 5)
Selection.HomeKey wdStory
Set oRng = ActiveDocument.Paragraphs(1).Range
For i = 1 To ActiveDocument.Paragraphs.Count
Selection.MoveDown wdLine
Set oTest = Selection.Paragraphs(1).Range
If Len(oTest) = 1 Then
oRng.End = oTest.Start
If oRng.Paragraphs.Count = iPara Then
oRng.HighlightColorIndex = wdYellow
Else
oRng.HighlightColorIndex = wdAuto
End If
oRng.Start = oTest.End
End If
Next i
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Graham Mayor wrote:
Assuming that when imported into Word each line ends with a
paragraph
mark, and there is an empty paragraph between each 'verse' then the
following macro will highlight all the sections with 5 or more
paragraphs in yellow.
Sub HiLightFive()
Dim oRng As Range
Dim oTest As Range
Dim i As Long
Selection.HomeKey wdStory
Set oRng = ActiveDocument.Paragraphs(1).Range
For i = 1 To ActiveDocument.Paragraphs.Count
Selection.MoveDown wdLine
Set oTest = Selection.Paragraphs(1).Range
If Len(oTest) = 1 Then
oRng.End = oTest.Start
If oRng.Paragraphs.Count 4 Then
oRng.HighlightColorIndex = wdYellow
End If
oRng.Start = oTest.End
End If
Next i
End Sub

http://www.gmayor.com/installing_macro.htm



eman wrote:
Hi,

Here under the line you can see a small part of subtitles of a
movie.
As you can see there are paragraphs of 3, 4 and 5 short verses.
For
example 1st paragraph is with 3 verses, 2nd is with 4 verse and
the
5th is with 5 verses.

The 3rd paragraph is with 5 verses and it is wrong (for me). I
want
only paragraphs with 3 and 4 verses.

What I am looking for is, if it is possible that Words can mark
automatically paragraphs with 5 verses for example with a color
instead of checking manually all the document, because subtitles
of a
movie are very long!

Maybe it's impossible but I am just asking.

I always remember of Google highlighter, it is very usefull when
you
are searching for a word because you can see the word colored
easily.
Maybe there is something similar in Word.

Thanks in advance

__________________________________________________ ___

574
00:29:55,960 -- 00:29:58,087
I know. I have no idea.

575
00:29:58,163 -- 00:30:00,996
It's, like, the wrong time to let
the guy know that you're crazy.

576
00:30:01,065 -- 00:30:03,533
- You know what I mean? It's not how
I'd play it.
- Yeah.
















  #12  
Old April 20th, 2009, 01:08 AM posted to microsoft.public.word.newusers
Suzanne S. Barnhill
external usenet poster
 
Posts: 31,786
Default Highlighter Or Something Like that :-)

So read the parts that pertain to Word 2007 and follow them.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org

"eman" wrote in message
...
I'm not stubborn and you are not helpful

"Suzanne S. Barnhill" wrote in message
...
Are you incapable of scrolling down past the first screen? The article at
http://www.gmayor.com/installing_macro.htm has several sections
specifically devoted to Word 2007. If you are too stubborn to find them,
then you're on your own.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org

"eman" wrote in message
...
Hi Suzanne, you are trying to be smart!!!!!!!!!! The link Graham
suggested is for 2000-2003.
And Suzanne I am not asking you but thanks anyway. What I need is how
can I use the document (or macro) that Graham posted?
Or I have to install Macro first? I am new to this and I am confused.

"Suzanne S. Barnhill" wrote in message
...
I guess it was a complete waste of time for Graham to include the parts
that say, "In Word 2007..."?

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org

"eman" wrote in message
...
It is for Word 2000-2003, I have Word 2007

"Suzanne S. Barnhill" wrote in message
...
Graham provided this information in his initial post:
http://www.gmayor.com/installing_macro.htm

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org

"eman" wrote in message
...
Hi, as I never used maros before, please can you tell me how can I
make use of it?

10X

"Graham Mayor" wrote in message
...
Testing the macro on the 125 pages of subtitles from 'The Godfather
III', the macro takes just over a minute to run through and mark
the whole document. In doing so I came up with a minor refinement
which will allow you to re-mark the document by running the macro
again with a different value for the number of lines. Setting the
value to 1 will remove the highlight, though there are much faster
ways to remove the highlight e.g.

Sub RemoveTheHighlight()
ActiveDocument.Range.HighlightColorIndex = wdAuto
End Sub

Revised macro:

Sub HiLightFive()
Dim oRng As Range
Dim oTest As Range
Dim i As Long
Dim iPara As Integer
iPara = InputBox("Highlight how many lines?", _
"Subtitle", 5)
Selection.HomeKey wdStory
Set oRng = ActiveDocument.Paragraphs(1).Range
For i = 1 To ActiveDocument.Paragraphs.Count
Selection.MoveDown wdLine
Set oTest = Selection.Paragraphs(1).Range
If Len(oTest) = 1 Then
oRng.End = oTest.Start
If oRng.Paragraphs.Count = iPara Then
oRng.HighlightColorIndex = wdYellow
Else
oRng.HighlightColorIndex = wdAuto
End If
oRng.Start = oTest.End
End If
Next i
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Graham Mayor wrote:
Assuming that when imported into Word each line ends with a
paragraph
mark, and there is an empty paragraph between each 'verse' then
the
following macro will highlight all the sections with 5 or more
paragraphs in yellow.
Sub HiLightFive()
Dim oRng As Range
Dim oTest As Range
Dim i As Long
Selection.HomeKey wdStory
Set oRng = ActiveDocument.Paragraphs(1).Range
For i = 1 To ActiveDocument.Paragraphs.Count
Selection.MoveDown wdLine
Set oTest = Selection.Paragraphs(1).Range
If Len(oTest) = 1 Then
oRng.End = oTest.Start
If oRng.Paragraphs.Count 4 Then
oRng.HighlightColorIndex = wdYellow
End If
oRng.Start = oTest.End
End If
Next i
End Sub

http://www.gmayor.com/installing_macro.htm



eman wrote:
Hi,

Here under the line you can see a small part of subtitles of a
movie.
As you can see there are paragraphs of 3, 4 and 5 short verses.
For
example 1st paragraph is with 3 verses, 2nd is with 4 verse and
the
5th is with 5 verses.

The 3rd paragraph is with 5 verses and it is wrong (for me). I
want
only paragraphs with 3 and 4 verses.

What I am looking for is, if it is possible that Words can mark
automatically paragraphs with 5 verses for example with a color
instead of checking manually all the document, because subtitles
of a
movie are very long!

Maybe it's impossible but I am just asking.

I always remember of Google highlighter, it is very usefull when
you
are searching for a word because you can see the word colored
easily.
Maybe there is something similar in Word.

Thanks in advance

__________________________________________________ ___

574
00:29:55,960 -- 00:29:58,087
I know. I have no idea.

575
00:29:58,163 -- 00:30:00,996
It's, like, the wrong time to let
the guy know that you're crazy.

576
00:30:01,065 -- 00:30:03,533
- You know what I mean? It's not how
I'd play it.
- Yeah.


















  #13  
Old April 20th, 2009, 03:35 AM posted to microsoft.public.word.newusers
eman
external usenet poster
 
Posts: 20
Default Highlighter Or Something Like that :-)

I read everything and still can't understand how to use macro. Do I have to
paste the subtitles first and then I click on the macro? Do I have to click
on macro first then I paste the subtitles? When I am clicking on the macro
it is deleting all the subtitles and are being replaced by the macro that
Graham wrote! I really need step by step because I am a newbie. Still have
no idea at all.

"Suzanne S. Barnhill" wrote in message
...
So read the parts that pertain to Word 2007 and follow them.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org

"eman" wrote in message
...
I'm not stubborn and you are not helpful

"Suzanne S. Barnhill" wrote in message
...
Are you incapable of scrolling down past the first screen? The article
at http://www.gmayor.com/installing_macro.htm has several sections
specifically devoted to Word 2007. If you are too stubborn to find them,
then you're on your own.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org

"eman" wrote in message
...
Hi Suzanne, you are trying to be smart!!!!!!!!!! The link Graham
suggested is for 2000-2003.
And Suzanne I am not asking you but thanks anyway. What I need is how
can I use the document (or macro) that Graham posted?
Or I have to install Macro first? I am new to this and I am confused.

"Suzanne S. Barnhill" wrote in message
...
I guess it was a complete waste of time for Graham to include the parts
that say, "In Word 2007..."?

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org

"eman" wrote in message
...
It is for Word 2000-2003, I have Word 2007

"Suzanne S. Barnhill" wrote in message
...
Graham provided this information in his initial post:
http://www.gmayor.com/installing_macro.htm

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org

"eman" wrote in message
...
Hi, as I never used maros before, please can you tell me how can I
make use of it?

10X

"Graham Mayor" wrote in message
...
Testing the macro on the 125 pages of subtitles from 'The
Godfather III', the macro takes just over a minute to run through
and mark the whole document. In doing so I came up with a minor
refinement which will allow you to re-mark the document by running
the macro again with a different value for the number of lines.
Setting the value to 1 will remove the highlight, though there are
much faster ways to remove the highlight e.g.

Sub RemoveTheHighlight()
ActiveDocument.Range.HighlightColorIndex = wdAuto
End Sub

Revised macro:

Sub HiLightFive()
Dim oRng As Range
Dim oTest As Range
Dim i As Long
Dim iPara As Integer
iPara = InputBox("Highlight how many lines?", _
"Subtitle", 5)
Selection.HomeKey wdStory
Set oRng = ActiveDocument.Paragraphs(1).Range
For i = 1 To ActiveDocument.Paragraphs.Count
Selection.MoveDown wdLine
Set oTest = Selection.Paragraphs(1).Range
If Len(oTest) = 1 Then
oRng.End = oTest.Start
If oRng.Paragraphs.Count = iPara Then
oRng.HighlightColorIndex = wdYellow
Else
oRng.HighlightColorIndex = wdAuto
End If
oRng.Start = oTest.End
End If
Next i
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Graham Mayor wrote:
Assuming that when imported into Word each line ends with a
paragraph
mark, and there is an empty paragraph between each 'verse' then
the
following macro will highlight all the sections with 5 or more
paragraphs in yellow.
Sub HiLightFive()
Dim oRng As Range
Dim oTest As Range
Dim i As Long
Selection.HomeKey wdStory
Set oRng = ActiveDocument.Paragraphs(1).Range
For i = 1 To ActiveDocument.Paragraphs.Count
Selection.MoveDown wdLine
Set oTest = Selection.Paragraphs(1).Range
If Len(oTest) = 1 Then
oRng.End = oTest.Start
If oRng.Paragraphs.Count 4 Then
oRng.HighlightColorIndex = wdYellow
End If
oRng.Start = oTest.End
End If
Next i
End Sub

http://www.gmayor.com/installing_macro.htm



eman wrote:
Hi,

Here under the line you can see a small part of subtitles of a
movie.
As you can see there are paragraphs of 3, 4 and 5 short verses.
For
example 1st paragraph is with 3 verses, 2nd is with 4 verse and
the
5th is with 5 verses.

The 3rd paragraph is with 5 verses and it is wrong (for me). I
want
only paragraphs with 3 and 4 verses.

What I am looking for is, if it is possible that Words can mark
automatically paragraphs with 5 verses for example with a color
instead of checking manually all the document, because subtitles
of a
movie are very long!

Maybe it's impossible but I am just asking.

I always remember of Google highlighter, it is very usefull when
you
are searching for a word because you can see the word colored
easily.
Maybe there is something similar in Word.

Thanks in advance

__________________________________________________ ___

574
00:29:55,960 -- 00:29:58,087
I know. I have no idea.

575
00:29:58,163 -- 00:30:00,996
It's, like, the wrong time to let
the guy know that you're crazy.

576
00:30:01,065 -- 00:30:03,533
- You know what I mean? It's not how
I'd play it.
- Yeah.




















  #14  
Old April 20th, 2009, 04:31 AM posted to microsoft.public.word.newusers
Suzanne S. Barnhill
external usenet poster
 
Posts: 31,786
Default Highlighter Or Something Like that :-)

You have to install the macro by following the instructions in Graham's
article. Then you run it.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org

"eman" wrote in message
...
I read everything and still can't understand how to use macro. Do I have to
paste the subtitles first and then I click on the macro? Do I have to click
on macro first then I paste the subtitles? When I am clicking on the macro
it is deleting all the subtitles and are being replaced by the macro that
Graham wrote! I really need step by step because I am a newbie. Still have
no idea at all.

"Suzanne S. Barnhill" wrote in message
...
So read the parts that pertain to Word 2007 and follow them.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org

"eman" wrote in message
...
I'm not stubborn and you are not helpful

"Suzanne S. Barnhill" wrote in message
...
Are you incapable of scrolling down past the first screen? The article
at http://www.gmayor.com/installing_macro.htm has several sections
specifically devoted to Word 2007. If you are too stubborn to find
them, then you're on your own.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org

"eman" wrote in message
...
Hi Suzanne, you are trying to be smart!!!!!!!!!! The link Graham
suggested is for 2000-2003.
And Suzanne I am not asking you but thanks anyway. What I need is how
can I use the document (or macro) that Graham posted?
Or I have to install Macro first? I am new to this and I am confused.

"Suzanne S. Barnhill" wrote in message
...
I guess it was a complete waste of time for Graham to include the
parts that say, "In Word 2007..."?

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org

"eman" wrote in message
...
It is for Word 2000-2003, I have Word 2007

"Suzanne S. Barnhill" wrote in message
...
Graham provided this information in his initial post:
http://www.gmayor.com/installing_macro.htm

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org

"eman" wrote in message
...
Hi, as I never used maros before, please can you tell me how can I
make use of it?

10X

"Graham Mayor" wrote in message
...
Testing the macro on the 125 pages of subtitles from 'The
Godfather III', the macro takes just over a minute to run through
and mark the whole document. In doing so I came up with a minor
refinement which will allow you to re-mark the document by
running the macro again with a different value for the number of
lines. Setting the value to 1 will remove the highlight, though
there are much faster ways to remove the highlight e.g.

Sub RemoveTheHighlight()
ActiveDocument.Range.HighlightColorIndex = wdAuto
End Sub

Revised macro:

Sub HiLightFive()
Dim oRng As Range
Dim oTest As Range
Dim i As Long
Dim iPara As Integer
iPara = InputBox("Highlight how many lines?", _
"Subtitle", 5)
Selection.HomeKey wdStory
Set oRng = ActiveDocument.Paragraphs(1).Range
For i = 1 To ActiveDocument.Paragraphs.Count
Selection.MoveDown wdLine
Set oTest = Selection.Paragraphs(1).Range
If Len(oTest) = 1 Then
oRng.End = oTest.Start
If oRng.Paragraphs.Count = iPara Then
oRng.HighlightColorIndex = wdYellow
Else
oRng.HighlightColorIndex = wdAuto
End If
oRng.Start = oTest.End
End If
Next i
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Graham Mayor wrote:
Assuming that when imported into Word each line ends with a
paragraph
mark, and there is an empty paragraph between each 'verse' then
the
following macro will highlight all the sections with 5 or more
paragraphs in yellow.
Sub HiLightFive()
Dim oRng As Range
Dim oTest As Range
Dim i As Long
Selection.HomeKey wdStory
Set oRng = ActiveDocument.Paragraphs(1).Range
For i = 1 To ActiveDocument.Paragraphs.Count
Selection.MoveDown wdLine
Set oTest = Selection.Paragraphs(1).Range
If Len(oTest) = 1 Then
oRng.End = oTest.Start
If oRng.Paragraphs.Count 4 Then
oRng.HighlightColorIndex = wdYellow
End If
oRng.Start = oTest.End
End If
Next i
End Sub

http://www.gmayor.com/installing_macro.htm



eman wrote:
Hi,

Here under the line you can see a small part of subtitles of a
movie.
As you can see there are paragraphs of 3, 4 and 5 short verses.
For
example 1st paragraph is with 3 verses, 2nd is with 4 verse and
the
5th is with 5 verses.

The 3rd paragraph is with 5 verses and it is wrong (for me). I
want
only paragraphs with 3 and 4 verses.

What I am looking for is, if it is possible that Words can mark
automatically paragraphs with 5 verses for example with a color
instead of checking manually all the document, because
subtitles of a
movie are very long!

Maybe it's impossible but I am just asking.

I always remember of Google highlighter, it is very usefull
when you
are searching for a word because you can see the word colored
easily.
Maybe there is something similar in Word.

Thanks in advance

__________________________________________________ ___

574
00:29:55,960 -- 00:29:58,087
I know. I have no idea.

575
00:29:58,163 -- 00:30:00,996
It's, like, the wrong time to let
the guy know that you're crazy.

576
00:30:01,065 -- 00:30:03,533
- You know what I mean? It's not how
I'd play it.
- Yeah.





















  #15  
Old April 20th, 2009, 07:15 AM posted to microsoft.public.word.newusers
Graham Mayor
external usenet poster
 
Posts: 18,297
Default Highlighter Or Something Like that :-)

The link - http://www.gmayor.com/installing_macro.htm explains how to
install macro listings in all Word versions that can use the macros, with
separate illustrations for Word 2007 where appropriate.

The page uses a macro listing to update fields in a document as an example.
You simply replace that listing with the listing from my earlier message.
All of this is explained on my web page.

If you attach the macro to a button on the QAT (Quick Access Toolbar) as
shown, then with the subtitle document opened and displayed in Word (For the
purpose of testing, I opened the SRT subtitle file in Word 2007.) clicking
the toolbar button will cause the macro to run on that document. I don't
know how to explain it any more simply.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org






eman wrote:
I read everything and still can't understand how to use macro. Do I
have to paste the subtitles first and then I click on the macro? Do I
have to click on macro first then I paste the subtitles? When I am
clicking on the macro it is deleting all the subtitles and are being
replaced by the macro that Graham wrote! I really need step by step
because I am a newbie. Still have no idea at all.

"Suzanne S. Barnhill" wrote in message
...
So read the parts that pertain to Word 2007 and follow them.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org

"eman" wrote in message
...
I'm not stubborn and you are not helpful

"Suzanne S. Barnhill" wrote in message
...
Are you incapable of scrolling down past the first screen? The
article at http://www.gmayor.com/installing_macro.htm has several
sections specifically devoted to Word 2007. If you are too
stubborn to find them, then you're on your own.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org

"eman" wrote in message
...
Hi Suzanne, you are trying to be smart!!!!!!!!!! The link Graham
suggested is for 2000-2003.
And Suzanne I am not asking you but thanks anyway. What I need is
how can I use the document (or macro) that Graham posted?
Or I have to install Macro first? I am new to this and I am
confused. "Suzanne S. Barnhill" wrote in message
...
I guess it was a complete waste of time for Graham to include
the parts that say, "In Word 2007..."?

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org

"eman" wrote in message
...
It is for Word 2000-2003, I have Word 2007

"Suzanne S. Barnhill" wrote in message
...
Graham provided this information in his initial post:
http://www.gmayor.com/installing_macro.htm

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org

"eman" wrote in message
...
Hi, as I never used maros before, please can you tell me how
can I make use of it?

10X

"Graham Mayor" wrote in message
...
Testing the macro on the 125 pages of subtitles from 'The
Godfather III', the macro takes just over a minute to run
through and mark the whole document. In doing so I came up
with a minor refinement which will allow you to re-mark the
document by running the macro again with a different value
for the number of lines. Setting the value to 1 will remove
the highlight, though there are much faster ways to remove
the highlight e.g. Sub RemoveTheHighlight()
ActiveDocument.Range.HighlightColorIndex = wdAuto
End Sub

Revised macro:

Sub HiLightFive()
Dim oRng As Range
Dim oTest As Range
Dim i As Long
Dim iPara As Integer
iPara = InputBox("Highlight how many lines?", _
"Subtitle", 5)
Selection.HomeKey wdStory
Set oRng = ActiveDocument.Paragraphs(1).Range
For i = 1 To ActiveDocument.Paragraphs.Count
Selection.MoveDown wdLine
Set oTest = Selection.Paragraphs(1).Range
If Len(oTest) = 1 Then
oRng.End = oTest.Start
If oRng.Paragraphs.Count = iPara Then
oRng.HighlightColorIndex = wdYellow
Else
oRng.HighlightColorIndex = wdAuto
End If
oRng.Start = oTest.End
End If
Next i
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Graham Mayor wrote:
Assuming that when imported into Word each line ends with a
paragraph
mark, and there is an empty paragraph between each 'verse'
then the
following macro will highlight all the sections with 5 or
more paragraphs in yellow.
Sub HiLightFive()
Dim oRng As Range
Dim oTest As Range
Dim i As Long
Selection.HomeKey wdStory
Set oRng = ActiveDocument.Paragraphs(1).Range
For i = 1 To ActiveDocument.Paragraphs.Count
Selection.MoveDown wdLine
Set oTest = Selection.Paragraphs(1).Range
If Len(oTest) = 1 Then
oRng.End = oTest.Start
If oRng.Paragraphs.Count 4 Then
oRng.HighlightColorIndex = wdYellow
End If
oRng.Start = oTest.End
End If
Next i
End Sub

http://www.gmayor.com/installing_macro.htm



eman wrote:
Hi,

Here under the line you can see a small part of subtitles
of a movie.
As you can see there are paragraphs of 3, 4 and 5 short
verses. For
example 1st paragraph is with 3 verses, 2nd is with 4
verse and the
5th is with 5 verses.

The 3rd paragraph is with 5 verses and it is wrong (for
me). I want
only paragraphs with 3 and 4 verses.

What I am looking for is, if it is possible that Words can
mark automatically paragraphs with 5 verses for example
with a color instead of checking manually all the
document, because subtitles of a
movie are very long!

Maybe it's impossible but I am just asking.

I always remember of Google highlighter, it is very
usefull when you
are searching for a word because you can see the word
colored easily.
Maybe there is something similar in Word.

Thanks in advance

__________________________________________________ ___

574
00:29:55,960 -- 00:29:58,087
I know. I have no idea.

575
00:29:58,163 -- 00:30:00,996
It's, like, the wrong time to let
the guy know that you're crazy.

576
00:30:01,065 -- 00:30:03,533
- You know what I mean? It's not how
I'd play it.
- Yeah.



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:50 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.