Parenthesize a word in one operation?

M

Montserrat

Hi,

In word 2001 is there a way to parenthesize or bracket, a word, sentence or
paragraph in one operation after the word, etc., has been written?

In other words, if I write a sentence without parentheses, and then decide
to add parentheses (or brackets) to it, can I do that without going to the
beginning of the sentence, typing a parenthesis, then going to the end of
the sentence and typing another parenthesis?

For instance, say, highlighting the sentence, then performing a one time
function which adds both parentheses, at either end, at once.

Thanks

Rafael
 
M

matt neuburg

Montserrat said:
In word 2001 is there a way to parenthesize or bracket, a word, sentence or
paragraph in one operation after the word, etc., has been written?

Sure. Write a macro. I have macros that parenthesize or quote the
selection, change two sentences to a single sentence of two clauses
separated by semicolon (and the reverse), and all the other common
boring stuff I do while writing. VBA is one of the best things about
Word! If you don't know how to write a macro, this would be an excellent
place to start; there's nothing like having a genuine need to provide
motivation, and the problem you're posing yourself is a simple one. m.
 
B

Beth Rosengard

Sure. Write a macro. I have macros that parenthesize or quote the
selection, change two sentences to a single sentence of two clauses
separated by semicolon (and the reverse), and all the other common
boring stuff I do while writing. VBA is one of the best things about
Word! If you don't know how to write a macro, this would be an excellent
place to start; there's nothing like having a genuine need to provide
motivation, and the problem you're posing yourself is a simple one. m.

As a starting place for learning about macros, see this article:
<http://www.word.mvps.org/FAQs/MacrosVBA/UsingRecorder.htm>

And check this one for the differences between PC and Mac:
<http://word.mvps.org/MacWordNew/Differences.htm>

(If you're using Safari, you'll probably have to hit Refresh a couple of
times; other browsers should be fine.)

--
Beth Rosengard
Mac MVP

Mac Word FAQ: <http://word.mvps.org/MacWordNew/index.htm>
Entourage Help Page: <http://www.entourage.mvps.org>
 
J

JE McGimpsey

For instance, say, highlighting the sentence, then performing a one time
function which adds both parentheses, at either end, at once.

One way:

Public Sub Parenthesize()
With Selection
If Right(.Text, 1) <> " " Then
.Text = "(" & .Text & ")"
Else
.Text = "(" & Left(.Text, Len(.Text) - 1) & ") "
End If
End With
End Sub

This is pretty minimal.
 
B

Bill Weylock

I suppose this is a dumb question, but I have not messed with macros after
painful attempts in Word 6 (as I recall)...

Will this work in 2004?


Best,


- Bill


One way:

Public Sub Parenthesize()
With Selection
If Right(.Text, 1) <> " " Then
.Text = "(" & .Text & ")"
Else
.Text = "(" & Left(.Text, Len(.Text) - 1) & ") "
End If
End With
End Sub

This is pretty minimal.



Panther 10.3.4
Office 2004
 
M

Montserrat

Montserrat:
I don't speak that language. Could you please explain your response to me?

"For instance, say, highlighting the sentence, then performing a one time
function which adds both parentheses, at either end, at once.

JE McGimpsey:
One way:

Public Sub Parenthesize()
With Selection
If Right(.Text, 1) <> " " Then
.Text = "(" & .Text & ")"
Else
.Text = "(" & Left(.Text, Len(.Text) - 1) & ") "
End If
End With
End Sub

This is pretty minimal.

From: JE McGimpsey <[email protected]>
Organization: McGimpsey & Assoc,
Newsgroups: microsoft.public.mac.office.word
Date: Tue, 03 Aug 2004 00:45:40 -0600
Subject: Re: Parenthesize a word in one operation?

Montserrat <[email protected]> wrote:
 
J

JE McGimpsey

Bill Weylock said:
I suppose this is a dumb question, but I have not messed with macros after
painful attempts in Word 6 (as I recall)...

Will this work in 2004?

Yes.
 
B

Bill Weylock

I just did my best to create this macro and ran it.

In fact, it did parenthesize the selected word or words, but it also made
them upper case. Is this a wild malfunction of some sort caused by my inept
implementation? I certainly see nothing in your script that seems to call
for a change of case.

Thanks!


Best,


- Bill





Panther 10.3.4
Office 2004
 
P

Paul Berkowitz

Did you have your caps lock key down at the time?

--
Paul Berkowitz
MVP MacOffice
Entourage FAQ Page: <http://www.entourage.mvps.org/faq/index.html>
AppleScripts for Entourage: <http://macscripter.net/scriptbuilders/>

Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.

PLEASE always state which version of Microsoft Office you are using -
**2004**, X or 2001. It's often impossible to answer your questions
otherwise.



From: Bill Weylock <[email protected]>
Newsgroups: microsoft.public.mac.office.word
Date: Tue, 03 Aug 2004 17:31:42 -0700
Subject: Re: Parenthesize a word in one operation?

I just did my best to create this macro and ran it.

In fact, it did parenthesize the selected word or words, but it also made
them upper case. Is this a wild malfunction of some sort caused by my inept
implementation? I certainly see nothing in your script that seems to call
for a change of case.

Thanks!


Best,


- Bill





Panther 10.3.4
Office 2004
 
B

Bill Weylock

No. It was sillier than that.

I was working in Outline View (which I had forgotten and rarely do) with
text formatting turned off. The style for the heading was ³All Caps² among
many other things.

Mystery solved! Thanks.


Best,


- Bill


Did you have your caps lock key down at the time?




Panther 10.3.4
Office 2004
 
M

Montserrat

Thanks to

JE McGimpsey
Beth Rosengard
matt neuburg
Anyone I forgot

For not only solving the problem, but also for turning me on to many other
useful things.

Rafael

Parenthesize a word in one operation?


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

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