make a word and following period bold

J

jkmar5

Hi,

I am formatting a glossary that has over 500 entries. I have to select the
first word and period in each entry and make it bold. (the word and period is
followed by the definition in sentence form).

Is there a way to do a find/replace for this? Or a macro I could use? I
could do a find/replace from each paragraph mark to the next period and make
that bold, but I couldn't get it to work.

Thanks!
 
J

jkmar5

P.S. This is what I need the final copy to look like:

consumers. People who buy and use finished products. (3)
continuum. A sliding scale from one extreme to another with infinite
possible responses falling at different points along it. (3, 9)

The first word and period need to be bold.

Thanks.
 
D

Doug Robbins - Word MVP

Use

Dim i As Long
Dim fword As Range
With ActiveDocument
For i = 1 To .Paragraphs.Count
Set fword = .Paragraphs(i).Range.Words(1)
fword.End = fword.End + 1
fword.Font.Bold = True
Next i
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
J

jkmar5

Thanks, it works good on the one-word entries, but if there is a
multiple-word entry, ending with a period, it only makes the first word bold
and the first letter of the next word bold. Is there any way around this?

For example, in the entry below, the macro makes the word sales bold and
then the letter "t" in tax, but not the rest.

sales tax. An extra percentage of a purchase collected by retailers in most
states to be paid to the state government. (18)

Also, in hypenated entries, the macro only makes the part of the word before
the hypen bold. See below, only "self" would be bolded by the macro.

self-help features. Attributes of garments that enable children, as well as
people with disabilities or older people, to dress themselves. (14)

Thanks for your help, if I can't find a solution at least your macro will
help cut my time in half.
 
D

Doug Robbins - Word MVP

Dim i As Long
Dim fword As Range
With ActiveDocument
For i = 1 To .Paragraphs.Count
Set fword = .Paragraphs(i).Range
fword.End = fword.Start + InStr(fword, ".")
fword.Font.Bold = True
Next i
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

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