Alternating Bold Paragraphs

S

Samo

I'm using Microsoft Word 98 and trying to basically have every other
paragraph be in bold. Each paragraph is separated by a blank line. Is there
a way of writing a conditional script in which each time a blank line is
recognized, the bold format is toggled?

Thanks!
 
M

macropod

Hi Samo,

AFAIK, you can't do this while typing in the document. However, you could run a suitable macro to do the alternate paragraph bolding
for you. Here's some code to play with:

Sub ParagraphFormatter()
Dim oRng As Range
Dim i As Long
With ActiveDocument
For i = 1 To .Paragraphs.Count
If i Mod 2 = 0 Then
.Paragraphs(i).Range.Bold = True
Else
.Paragraphs(i).Range.Bold = False
End If
Next i
End With
End Sub
 
T

Tony Jollans

You could do it while typing if you used two styles - differing only in
their boldness - each set with the other as the next style - and each with
space after so you didn't need to type the blank line. It wouldn't work if
you wanted to insert paragraphs in the middle, though.

--
Enjoy,
Tony

www.WordArticles.com

macropod said:
Hi Samo,

AFAIK, you can't do this while typing in the document. However, you could
run a suitable macro to do the alternate paragraph bolding for you. Here's
some code to play with:

Sub ParagraphFormatter()
Dim oRng As Range
Dim i As Long
With ActiveDocument
For i = 1 To .Paragraphs.Count
If i Mod 2 = 0 Then
.Paragraphs(i).Range.Bold = True
Else
.Paragraphs(i).Range.Bold = False
End If
Next i
End With
End Sub

--
Cheers
macropod
[MVP - Microsoft Word]


Samo said:
I'm using Microsoft Word 98 and trying to basically have every other
paragraph be in bold. Each paragraph is separated by a blank line. Is
there
a way of writing a conditional script in which each time a blank line is
recognized, the bold format is toggled?

Thanks!
 
H

Helmut Weber

Hi Samo
I'm using Microsoft Word 98 and trying to basically have every other
paragraph be in bold. Each paragraph is separated by a blank line. Is there
a way of writing a conditional script in which each time a blank line is
recognized, the bold format is toggled?

what is a blank line for you?
An empty paragraph?

If so, your document layout needs improvement
(avoid empty paragraphs) and therefore what
both macropod and Tony have suggested wouldn't work,
though it would work in a document layouted properly.

--

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Vista Small Business, Office XP
 
M

macropod

Hi Tony,

Yes, two Styles could work - each defined to have the other as the 'following' paragraph Style.

--
Cheers
macropod
[MVP - Microsoft Word]


Tony Jollans said:
You could do it while typing if you used two styles - differing only in
their boldness - each set with the other as the next style - and each with
space after so you didn't need to type the blank line. It wouldn't work if
you wanted to insert paragraphs in the middle, though.

--
Enjoy,
Tony

www.WordArticles.com

macropod said:
Hi Samo,

AFAIK, you can't do this while typing in the document. However, you could
run a suitable macro to do the alternate paragraph bolding for you. Here's
some code to play with:

Sub ParagraphFormatter()
Dim oRng As Range
Dim i As Long
With ActiveDocument
For i = 1 To .Paragraphs.Count
If i Mod 2 = 0 Then
.Paragraphs(i).Range.Bold = True
Else
.Paragraphs(i).Range.Bold = False
End If
Next i
End With
End Sub

--
Cheers
macropod
[MVP - Microsoft Word]


Samo said:
I'm using Microsoft Word 98 and trying to basically have every other
paragraph be in bold. Each paragraph is separated by a blank line. Is
there
a way of writing a conditional script in which each time a blank line is
recognized, the bold format is toggled?

Thanks!
 

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

Top