macro to surrond selected text with parentheses

E

elgar22

I would like to write a macro in Word which allows me to surround any text I
have selected with a set of parentheses. How can I do this?
 
P

Peter Aitken

elgar22 said:
I would like to write a macro in Word which allows me to surround any text
I
have selected with a set of parentheses. How can I do this?

Selection.Text = Chr(32) & Selection.Text & Chr(32)

I think that 32 is the ASCII for a double quote - you might want to check!

Peter Aitken
 
J

Jean-Guy Marcil

Peter Aitken was telling us:
Peter Aitken nous racontait que :
-----------------------------^^^

Selection.Text = "(" & Selection.Text & ")"
Selection.Text = Chr(32) & Selection.Text & Chr(32)

I think that 32 is the ASCII for a double quote - you might want to
check!

Yes, but that was not the question!

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
[email protected]
Word MVP site: http://www.word.mvps.org
 
P

Peter Aitken

Jean-Guy Marcil said:
Peter Aitken was telling us:
Peter Aitken nous racontait que :

-----------------------------^^^

Selection.Text = "(" & Selection.Text & ")"


Yes, but that was not the question!

--

I guess I need a coffee!
 
Top