How to format select word wich was selected by double-click?

A

avkokin

How to format (to apply bold font) select word which was selected by
double-click? Whether probably executing any actions for selected word
by double-click of the mouse?
 
G

Graham Mayor

Selection.Font.Bold = True

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
A

avkokin

Selection.Font.Bold = True

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

My web sitewww.gmayor.com
Word MVP web sitehttp://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>




- Show quoted text -

Hello Graham. Thank's for answer, but I meaned other thing. I want to
format of the selection text when I double-click on the this text
(word). At once after double-click on this word. Is it possible? I
think what my question maybe not for VBA beginer... Sorry.
Thank you very much.
 
F

fumei via OfficeKB.com

No. You need something to tell Word to do something (like Selection.Font.
Bold = True). Double clicking will select...and nothing more. You need
something to TELL Word to do something more.

Are you sure you really want to do this? You could use WithEvents and
SelectionChange, but that would mean it would do it for ANY SelectionChange.
You could probably work out logic that could (possibly) cover other
SelectionChanges - besides a double click to Select - but what exactly are
you gaining?
Selection.Font.Bold = True
[quoted text clipped - 11 lines]
- Show quoted text -

Hello Graham. Thank's for answer, but I meaned other thing. I want to
format of the selection text when I double-click on the this text
(word). At once after double-click on this word. Is it possible? I
think what my question maybe not for VBA beginer... Sorry.
Thank you very much.
 
T

Tony Strazzeri

I haven't looked at the code to do this but what you are describing it
looks similar to what the Format Painter does.

You can see this by doing it manually.

Put your cursor on some text that is formatted as you want it (in your
case Bold), then double click on the Format Painter icod (the one with
the paintbrush icon). Double click on the icon will turn it on and
keep it on until you click on it again or you press Esc.

You can then double click other word and they will have the formatting
applied to them.

With this in mind you should be able to set up/select the initial
format you ant to apply and then turn the format painter on. I
haven't looked at the code to do this but it should be possible.

Post back if you have any problems with it and I will try it myself.

Hope this helps.

Cheers
TonyS.
 

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