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