Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.newusers
rohit92 rohit92 is offline
external usenet poster
 
Posts: 2
Default Selecting a word before a character to make bold...

Hey guys,
I think this might help me in the future, but I want to use something like
this for school. Say i have this text:
"dog- an animal that barks
cat- an animal that meows"

So what I want to do is select the words before the "-" to make them bold.
The words dog and cat should be bold. Sometimes i have very large lists to do
this with and it gets annoying to constantly select each word and make it
bold.. So let me know if it is possible.
  #2   Report Post  
Posted to microsoft.public.word.newusers
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Selecting a word before a character to make bold...

Select all of the paragraphs and then run a macro containing the following
code:

Dim i As Long
Dim rng As Range
With Selection
For i = 1 To .Paragraphs.Count
Set rng = .Paragraphs(i).Range
rng.End = rng.Start + InStr(rng, "-") - 1
rng.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, originally posted via msnews.microsoft.com
"rohit92" wrote in message
...
Hey guys,
I think this might help me in the future, but I want to use something like
this for school. Say i have this text:
"dog- an animal that barks
cat- an animal that meows"

So what I want to do is select the words before the "-" to make them bold.
The words dog and cat should be bold. Sometimes i have very large lists to
do
this with and it gets annoying to constantly select each word and make it
bold.. So let me know if it is possible.


  #3   Report Post  
Posted to microsoft.public.word.newusers
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Selecting a word before a character to make bold...

I see we have two threads on the same subject

--

Graham Mayor - Word MVP

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



Doug Robbins - Word MVP wrote:
Select all of the paragraphs and then run a macro containing the
following code:

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



Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
"rohit92" wrote in message
...
Hey guys,
I think this might help me in the future, but I want to use
something like this for school. Say i have this text:
"dog- an animal that barks
cat- an animal that meows"

So what I want to do is select the words before the "-" to make them
bold. The words dog and cat should be bold. Sometimes i have very
large lists to do
this with and it gets annoying to constantly select each word and
make it bold.. So let me know if it is possible.



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
Selecting text inserts a tab character Bagheera Microsoft Word Help 3 October 2nd 09 05:39 PM
Bold/Character Styles Tombo Microsoft Word Help 1 October 27th 08 08:15 PM
Stop selecting whole line when select first character? JoeFrum New Users 3 August 15th 07 06:03 AM
Character style without specifying a font (e.g. for bold or underl themint100 Page Layout 9 February 7th 07 05:48 PM
how do i make a sentence bold without making everything bold? drbob1125 Microsoft Word Help 1 August 15th 06 03:30 AM


All times are GMT +1. The time now is 03:44 PM.

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"