PC Review


Reply
Thread Tools Rate Thread

Re: macro for stripping

 
 
Larry
Guest
Posts: n/a
 
      8th Jul 2003
This macro will do it. I created it by recording.

Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "\([0-9]{1,2}\)"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll


Larry


 
Reply With Quote
 
 
 
 
feagin
Guest
Posts: n/a
 
      8th Jul 2003
Many thanks, great tips. The text to be deleted takes this
form: (1), (50), (34), and so forth. JF


>-----Original Message-----
>This macro will do it. I created it by recording.
>
> Selection.Find.ClearFormatting
> Selection.Find.Replacement.ClearFormatting
> With Selection.Find
> .Text = "\([0-9]{1,2}\)"
> .Replacement.Text = ""
> .Forward = True
> .Wrap = wdFindContinue
> .MatchWildcards = True
> End With
> Selection.Find.Execute Replace:=wdReplaceAll
>
>
>Larry
>
>
>.
>

 
Reply With Quote
 
feagin
Guest
Posts: n/a
 
      8th Jul 2003

Hi, I am not clear on how one puts wildcards into the find
dialog box, as in the illustration below. Also, how do I
do all this just by recording? What do you do, for
example, to set the 'true' criterion? Do I need to learn
VBA to do this?

>-----Original Message-----
>Many thanks, great tips. The text to be deleted takes

this
>form: (1), (50), (34), and so forth. JF
>
>
>>-----Original Message-----
>>This macro will do it. I created it by recording.
>>
>> Selection.Find.ClearFormatting
>> Selection.Find.Replacement.ClearFormatting
>> With Selection.Find
>> .Text = "\([0-9]{1,2}\)"
>> .Replacement.Text = ""
>> .Forward = True
>> .Wrap = wdFindContinue
>> .MatchWildcards = True
>> End With
>> Selection.Find.Execute Replace:=wdReplaceAll
>>
>>
>>Larry
>>
>>
>>.
>>

>.
>

 
Reply With Quote
 
Jay Freedman
Guest
Posts: n/a
 
      8th Jul 2003
In the Find&Replace dialog, click the More button. Put a check in the box
"Use wildcards". Then enter the rest of the find and replace stuff. If
you're recording when you click the Replace All button, the resulting macro
will contain the .MatchWildcards = True line. The backslashes, braces, and
brackets in the .Text line have special meanings when wildcards are turned
on -- see http://www.mvps.org/word/FAQs/Genera...gWildcards.htm as Graham
told you.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://www.mvps.org/word

feagin wrote:
> Hi, I am not clear on how one puts wildcards into the find
> dialog box, as in the illustration below. Also, how do I
> do all this just by recording? What do you do, for
> example, to set the 'true' criterion? Do I need to learn
> VBA to do this?
>
>> -----Original Message-----
>> Many thanks, great tips. The text to be deleted takes this
>> form: (1), (50), (34), and so forth. JF
>>
>>
>>> -----Original Message-----
>>> This macro will do it. I created it by recording.
>>>
>>> Selection.Find.ClearFormatting
>>> Selection.Find.Replacement.ClearFormatting
>>> With Selection.Find
>>> .Text = "\([0-9]{1,2}\)"
>>> .Replacement.Text = ""
>>> .Forward = True
>>> .Wrap = wdFindContinue
>>> .MatchWildcards = True
>>> End With
>>> Selection.Find.Execute Replace:=wdReplaceAll
>>>
>>>
>>> Larry
>>>
>>>
>>> .
>>>

>> .



 
Reply With Quote
 
feagin
Guest
Posts: n/a
 
      9th Jul 2003
works fine, many thanks to all, JF


>-----Original Message-----
>In the Find&Replace dialog, click the More button. Put a

check in the box
>"Use wildcards". Then enter the rest of the find and

replace stuff. If
>you're recording when you click the Replace All button,

the resulting macro
>will contain the .MatchWildcards = True line. The

backslashes, braces, and
>brackets in the .Text line have special meanings when

wildcards are turned
>on -- see

http://www.mvps.org/word/FAQs/Genera...gWildcards.htm
as Graham
>told you.
>
>--
>Regards,
>Jay Freedman
>Microsoft Word MVP FAQ: http://www.mvps.org/word
>
>feagin wrote:
>> Hi, I am not clear on how one puts wildcards into the

find
>> dialog box, as in the illustration below. Also, how do

I
>> do all this just by recording? What do you do, for
>> example, to set the 'true' criterion? Do I need to

learn
>> VBA to do this?
>>
>>> -----Original Message-----
>>> Many thanks, great tips. The text to be deleted takes

this
>>> form: (1), (50), (34), and so forth. JF
>>>
>>>
>>>> -----Original Message-----
>>>> This macro will do it. I created it by recording.
>>>>
>>>> Selection.Find.ClearFormatting
>>>> Selection.Find.Replacement.ClearFormatting
>>>> With Selection.Find
>>>> .Text = "\([0-9]{1,2}\)"
>>>> .Replacement.Text = ""
>>>> .Forward = True
>>>> .Wrap = wdFindContinue
>>>> .MatchWildcards = True
>>>> End With
>>>> Selection.Find.Execute Replace:=wdReplaceAll
>>>>
>>>>
>>>> Larry
>>>>
>>>>
>>>> .
>>>>
>>> .

>
>
>.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help stripping a zipcode =?Utf-8?B?RGF2ZQ==?= Microsoft Access Queries 4 10th Apr 2007 04:37 AM
stripping out the first space =?Utf-8?B?Y2hpbGRvdGhlMTk4MHM=?= Microsoft Excel Programming 3 26th Jul 2006 11:11 PM
Stripping characters... VJ Microsoft ASP .NET 1 17th Jan 2006 11:20 PM
TEXT STRIPPING NH Microsoft Excel Worksheet Functions 6 30th Aug 2004 07:48 PM
Re: macro for stripping Graham Mayor Microsoft Word New Users 0 8th Jul 2003 06:05 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:46 AM.