Make letter in bold

L

Luc

Hi

I am not a programmer but i taugh this will be the best place to ask

I would like to know what approach i shoul use if i whant to make special
letter in bold.

Exactly i whant to bold any letter between « ...... » including the double
bracket.

could it be possible to have a macro?

if so any input will be well receive
 
S

Steven Marzuola

Luc said:
Hi

I would like to know what approach i shoul use if i whant to make special
letter in bold.

Exactly i whant to bold any letter between « ...... » including the double
bracket.

could it be possible to have a macro?

Luc,

Two parts: First, here's how to change the « » characters and all
characters between them to display as Bold. Do a Search and Rpelace
for this:

Find what: («[!»]@»)
Use Wildcards

Replace with: \1
Format: Font, Bold

To create the macro, just record it as you perform that step.

Do you know how to assign macros to keys and/or to buttons on the
toolbar?

Steven
 
L

Luc

Not sure how to assign a macro i will have to take a look if it is document i
guess il be able to do it.

but if i would like to start the macro to automatic check what i type and
propose me to bold or not the text. Something like a on off switch. This is
get more complicated i guess.

as for the search i should have taugh about it. sometime we are to involve
in sometihng that we forgot the basic.

Thank

Steven Marzuola said:
Luc said:
Hi

I would like to know what approach i shoul use if i whant to make special
letter in bold.

Exactly i whant to bold any letter between « ...... » including the double
bracket.

could it be possible to have a macro?

Luc,

Two parts: First, here's how to change the « » characters and all
characters between them to display as Bold. Do a Search and Rpelace
for this:

Find what: («[!»]@»)
Use Wildcards

Replace with: \1
Format: Font, Bold

To create the macro, just record it as you perform that step.

Do you know how to assign macros to keys and/or to buttons on the
toolbar?

Steven
 
S

Steven Marzuola

Luc,

I'm not sure how to make this an automatic check. It's something
like a spelling check, you just have to remember to do do it.

But this could help:

How about a macro (invoked by a keystroke or a toolbar button), that
inserts the opening character (« left guillemet) and applies the
attribute you have selected (in this case, Bold).

You type away, and when you're done, click the buttom or press the
keystroke, which runs macro again. This time it inserts the closing
guillemet character », and turns off the formatting.

If that will help, I can give you some detailed instructions. What
version of Word do you have? (There are minor differences, I use
Word 2000).

steven


Not sure how to assign a macro i will have to take a look if it is document i
guess il be able to do it.

but if i would like to start the macro to automatic check what i type and
propose me to bold or not the text. Something like a on off switch. This is
get more complicated i guess.

as for the search i should have taugh about it. sometime we are to involve
in sometihng that we forgot the basic.

Thank

:

Luc said:
Hi

I would like to know what approach i shoul use if i whant to make special
letter in bold.

Exactly i whant to bold any letter between « ...... » including the double
bracket.

could it be possible to have a macro?

Luc,

Two parts: First, here's how to change the « » characters and all
characters between them to display as Bold. Do a Search and Rpelace
for this:

Find what: («[!»]@»)
Use Wildcards

Replace with: \1
Format: Font, Bold

To create the macro, just record it as you perform that step.

Do you know how to assign macros to keys and/or to buttons on the
toolbar?

Steven
 
L

Luc

Yep i think that could be interesting.

waiting for your input

Thank

Steven Marzuola said:
Luc,

I'm not sure how to make this an automatic check. It's something
like a spelling check, you just have to remember to do do it.

But this could help:

How about a macro (invoked by a keystroke or a toolbar button), that
inserts the opening character (« left guillemet) and applies the
attribute you have selected (in this case, Bold).

You type away, and when you're done, click the buttom or press the
keystroke, which runs macro again. This time it inserts the closing
guillemet character », and turns off the formatting.

If that will help, I can give you some detailed instructions. What
version of Word do you have? (There are minor differences, I use
Word 2000).

steven


Not sure how to assign a macro i will have to take a look if it is document i
guess il be able to do it.

but if i would like to start the macro to automatic check what i type and
propose me to bold or not the text. Something like a on off switch. This is
get more complicated i guess.

as for the search i should have taugh about it. sometime we are to involve
in sometihng that we forgot the basic.

Thank

:

Luc wrote:

Hi

I would like to know what approach i shoul use if i whant to make special
letter in bold.

Exactly i whant to bold any letter between « ...... » including the double
bracket.

could it be possible to have a macro?

Luc,

Two parts: First, here's how to change the « » characters and all
characters between them to display as Bold. Do a Search and Rpelace
for this:

Find what: («[!»]@»)
Use Wildcards

Replace with: \1
Format: Font, Bold

To create the macro, just record it as you perform that step.

Do you know how to assign macros to keys and/or to buttons on the
toolbar?

Steven
 
S

Steven Marzuola

Luc,

Here's my suggested macro, and a verbal description.

P.S. If a more experienced VBA programmer has a more elegant method
to detect whether a particular style exists, I'd like to see it. Thanks

=======================

Sub FormatGuillemet()

On Error GoTo NoGuillemets

If ActiveDocument.Styles("zGuillemet").Type Then
GoTo ResumeGuillemets
End If

NoGuillemets:

ActiveDocument.Styles.Add Name:="zGuillemet",
Type:=wdStyleTypeCharacter
ActiveDocument.Styles("zGuillemet").BaseStyle = "Default
Paragraph Font"
ActiveDocument.Styles("zGuillemet").Font.Bold = True

ResumeGuillemets:

If Selection.Style = ActiveDocument.Styles("zGuillemet") Then
Selection.TypeText Text:="»"
Selection.Style = ActiveDocument.Styles("Default Paragraph Font")
Else
Selection.Style = ActiveDocument.Styles("zGuillemet")
Selection.TypeText Text:="«"
End If

End Sub

=======================

Here's how it works, in words:

Background: For tasks like this in which you are switching or
"toggling" between two different "states", I prefer to write a
single macro instead of two. The first step will be to detect which
action needs to be done. One macro button takes up less space on a
toolbar, and/or uses fewer programmable keys.

Next: The macro creates a style called "zGuillemet", if the current
document does not already have it. It then checks whether the
current point in the document has that style.

The first time you run it, of course, you will be in the "Normal"
document style and not "zGuillemet". The macro will apply the
"zGuillemet" style, which is simply the current style plus Bold,
then type the « character.

The next time you run it, the macro will detect that you are in the
"zGuillemet" style. It will type the closing guillemet character »
and then switch to the default paragraph style (that is, turning off
the Bold).


As to how to add the macro to your system, I think you should do
some reading of other resources. Just for starters:

http://word.mvps.org/FAQs/Customization/AsgnCmdOrMacroToToolbar.htm
http://wordprocessing.about.com/od/workingwithmacro1/l/blmacrointro.htm
http://word.mvps.org/FAQs/Customization/AsgnCmdOrMacroToHotkey.htm

Steven
 

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