Find and replace query - is this possible?

B

Bert Coules

I'd be grateful for any advice on this. Maybe I'm overlooking something
obvious...

I have a lengthy document which contains a lot of short comments in
brackets: (Comment).

I would like to change all the comments (but not the brackets) so that they
are underlined and in italics, but I can't work out a way of doing this
globally. Is there one?

Many thanks.
 
S

Suzanne S. Barnhill

One approach would be to search for all the text in brackets and format it
as underlined and in italics, then search for underlined italic left
brackets and remove the formatting, then repeat for underlined italic right
brackets.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org
 
B

Bert Coules

Suzanne said:
One approach would be to search for all the text in brackets and format it
as underlined and in italics, then search for underlined italic left
brackets and remove the formatting, then repeat for underlined italic
right brackets.

Suzanne, many thanks for your speedy reply, but I'm not sure that I know how
to search for all the text in brackets: I'll investigate. Perhaps I can
search for " ( wild cards ) " ?

Bert
 
B

Bert Coules

I've tried several different ways now, but I'm still finding snags.

With Use Wildcards ticked, Word thinks that round brackets are instructions
rather than characters. So I replaced left and right brackets with
different characters: ( became & and ) became £.

Then I tried replacing &*£ with &*£ [with format: italics specified].

I tried to specify underlined as well, but that option doesn't seem to be
available, strangely. Anyway, that's a minor concern because what happened
was...

....every bracketed comment was changed to &*£. Obviously I'm misusing the
wildcard facility in some way.

More experimentation required...

Bert
 
B

Bert Coules

OK, so it seems that * for a wildcard can only be used in the Find string,
not the Replace one. Which makes sense.

But I'm still stuck. Just how do I isolate all the phrases in brackets? I
tried recording a macro on the lines of

Find (
Begin to mark text
Go to )
Move one character to the left
Stop marking text

But of course Word's Mark Text facility doesn't lend itself to doing that.

Bert
 
S

Suzanne S. Barnhill

Because parentheses are reserved characters when using wildcards, you have
to "escape" them with a backslash (for more on using wildcards, see
http://www.gmayor.com/replace_using_wildcards.htm). So the "Find what"
string you want is:

\(*\)

Leave the "Replace with" box blank and press Ctrl+I, Ctrl+U to get Format:
Font: Italic, Underline. Replace All.

To remove the formatting from the brackets, clear the check box for "Use
wildcards" and just type the left or right bracket in the "Find what" box.
In the "Replace with" box, press Ctrl+I, Ctrl+U again to get Format: Font:
Not Italic, No underline. Replace All.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org
 
B

Bert Coules

Suzanne,

Many thanks for that, but I'm afraid it doesn't work: the \(*\) string is
not recognised, either in Find or Find and Replace.

Find returns the message "...the search item was not found" and Replace
reports "...has made 0 replacements".

I'm using Word 2000 running under Windows 7.

Bert
 
B

Bert Coules

Suzanne,

Please ignore my previous reply: I'm an idiot. I didn't have "Use
wildcards" ticked.

With that duly done, your suggested solution works beautifully.

Bert
 
B

Bert Coules

Suzanne said:

Quite. Thanks again for your help. One of the things that threw me when I
was experimenting was that although italics is listed as an option in the
Find & Replace Format/Font/Font style list, underline is not. Nor does
there seem to be an obvious way to specify it: I wouldn't have thought of
simply using Ctrl+U.

Bert
 
S

Suzanne S. Barnhill

You specify the underline in the Font dialog (through Replace) the same way
you would ordinarily, by choosing an underline style from the dropdown. The
keyboard shortcuts are just that, shortcuts.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org
 
B

Bert Coules

Suzanne said:
You specify the underline in the Font dialog (through Replace) the same
way you would ordinarily, by choosing an underline style from the
dropdown.

Not in my version (Word 2000) you don't. The Find & Replace
Format/Font/Font Style dropdown consists of:

Regular
Italic
Bold
Bold Italic
Not Bold
Not Italic

and nothing else. Not an Underline in sight.

Bert
 
S

Stefan Blom

Note that there is a separate drop down for "Underline style" in the Font
dialog box.

-- 
Stefan Blom
Microsoft Word MVP




---------------------------------------------
"Bert Coules" wrote in message
You specify the underline in the Font dialog (through Replace) the same
way you would ordinarily, by choosing an underline style from the
dropdown.

Not in my version (Word 2000) you don't. The Find & Replace
Format/Font/Font Style dropdown consists of:

Regular
Italic
Bold
Bold Italic
Not Bold
Not Italic

and nothing else. Not an Underline in sight.

Bert
 
B

Bert Coules

Stefan said:
Note that there is a separate drop
down for "Underline style" in the Font
dialog box.

Well, well, so there is. It had completely passed me by. Many thanks.

Bert
 

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