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?

Re: macro to surrond selected text with parentheses by Peter

Peter
Mon May 02 14:18:26 CDT 2005

"elgar22" <elgar22@discussions.microsoft.com> wrote in message
news:7A31D9BB-17D3-4941-83AE-65E9FA9342A1@microsoft.com...
>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



Re: macro to surrond selected text with parentheses by Jean-Guy

Jean-Guy
Mon May 02 15:17:17 CDT 2005

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

> "elgar22" <elgar22@discussions.microsoft.com> wrote in message
> news:7A31D9BB-17D3-4941-83AE-65E9FA9342A1@microsoft.com...
>> 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 = "(" & 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
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org




Re: macro to surrond selected text with parentheses by Peter

Peter
Mon May 02 15:22:42 CDT 2005

"Jean-Guy Marcil" <no-spam@leaveme.alone> wrote in message
news:uW2wvP1TFHA.2128@TK2MSFTNGP15.phx.gbl...
> Peter Aitken was telling us:
> Peter Aitken nous racontait que :
>
>> "elgar22" <elgar22@discussions.microsoft.com> wrote in message
>> news:7A31D9BB-17D3-4941-83AE-65E9FA9342A1@microsoft.com...
>>> 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 = "(" & 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!
>
> --

I guess I need a coffee!


--
Peter Aitken

Remove the crap from my email address before using.



Re: macro to surrond selected text with parentheses by Jean-Guy

Jean-Guy
Mon May 02 18:15:50 CDT 2005

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

> "Jean-Guy Marcil" <no-spam@leaveme.alone> wrote in message
> news:uW2wvP1TFHA.2128@TK2MSFTNGP15.phx.gbl...
>> Peter Aitken was telling us:
>> Peter Aitken nous racontait que :
>>
>>> "elgar22" <elgar22@discussions.microsoft.com> wrote in message
>>> news:7A31D9BB-17D3-4941-83AE-65E9FA9342A1@microsoft.com...
>>>> 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 = "(" & 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!
>>
>> --
>
> I guess I need a coffee!

lol
Have some cognac with it too!

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org