Re: Text. Replacment.Text
From: Charles Kenyon (msnewsgroup_at_remove.no.spam.addbalance.com)
Date: 04/14/04
- Next message: G. Ron Ryles: "MS Word Crisis?!?!?!"
- Previous message: Steved: "Text. Replacment.Text"
- In reply to: Steved: "Text. Replacment.Text"
- Next in thread: Steved: "Re: Text. Replacment.Text"
- Reply: Steved: "Re: Text. Replacment.Text"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 13 Apr 2004 20:38:46 -0500
Hi,
You need to let us know what it is you want your macro to do. For future
reference, questions about macros probably should be posted in
word.vba.beginners.
Also, which version of Word are you using?
You may find <URL: http://word.mvps.org/FAQs/General/UsingWildcards.htm>
useful, as well.
-- Charles Kenyon Word New User FAQ & Web Directory: <URL: http://addbalance.com/word/index.htm> Intermediate User's Guide to Microsoft Word (supplemented version of Microsoft's Legal Users' Guide) <URL: http://addbalance.com/usersguide/index.htm> See also the MVP FAQ: <URL: http://www.mvps.org/word/> which is awesome! --------- --------- --------- --------- --------- --------- This message is posted to a newsgroup. Please post replies and questions to the newsgroup so that others can learn from my ignorance and your wisdom. "Steved" <anonymous@discussions.microsoft.com> wrote in message news:1c2f601c421be$9f79a9b0$a401280a@phx.gbl... > Hello from Steved > Is it posible please to use VBA for the below as you can > see i have put in 2 text, Replacement.Text in a macro. Can > I have this run as a VBA if not can I have it so I can > shorten this macro hence it > .Text = "(CABALLERO PETE*)(^13)" > .Replacement.Text = "\1 Voodoo Rhythm \2" > .Text = "(*HALBERG*)(^13)" > .Replacement.Text = "\1 Star Way \2" > and so on I several of these to do. Thankyou. > > Selection.Find.ClearFormatting > Selection.Find.Replacement.ClearFormatting > With Selection.Find > .Text = "(*CABALLERO PETE*)(^13)" > .Replacement.Text = "\1 Voodoo Rhythm \2" > .Wrap = wdFindContinue > .Format = False > .MatchCase = False > .MatchWholeWord = False > .MatchWildcards = True > .MatchSoundsLike = False > .MatchAllWordForms = False > End With > Selection.Find.Execute > With Selection > If .Find.Forward = True Then > .Collapse Direction:=wdCollapseStart > Else > .Collapse Direction:=wdCollapseEnd > End If > .Find.Execute Replace:=wdReplaceOne > If .Find.Forward = True Then > .Collapse Direction:=wdCollapseEnd > Else > .Collapse Direction:=wdCollapseStart > End If > .Find.Execute > End With > Selection.Find.ClearFormatting > Selection.Find.Replacement.ClearFormatting > With Selection.Find > .Text = "(*HALBERG*)(^13)" > .Replacement.Text = "\1 Star Way \2" > .Forward = True > .Wrap = wdFindContinue > .Format = False > .MatchCase = False > .MatchWholeWord = False > .MatchWildcards = True > .MatchSoundsLike = False > .MatchAllWordForms = False > End With > Selection.Find.Execute > With Selection > If .Find.Forward = True Then > .Collapse Direction:=wdCollapseStart > Else > .Collapse Direction:=wdCollapseEnd > End If > .Find.Execute Replace:=wdReplaceOne > If .Find.Forward = True Then > .Collapse Direction:=wdCollapseEnd > Else > .Collapse Direction:=wdCollapseStart > End If > .Find.Execute > End With > End Sub >
- Next message: G. Ron Ryles: "MS Word Crisis?!?!?!"
- Previous message: Steved: "Text. Replacment.Text"
- In reply to: Steved: "Text. Replacment.Text"
- Next in thread: Steved: "Re: Text. Replacment.Text"
- Reply: Steved: "Re: Text. Replacment.Text"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|