Re: Text. Replacment.Text

From: Steved (anonymous_at_discussions.microsoft.com)
Date: 04/14/04

  • Next message: Grant: "Re: Cannot get rid of footnotes"
    Date: Tue, 13 Apr 2004 18:55:39 -0700
    
    

    Hello Charles from Steved [XP Office]

    What i am hoping to acheive is find a word like CABALLERO
    PETE which is a horses name. I have two paragraphs of
    information about each horse, but it does not have the
    breeding so in the case of CABALLERO PETE it is Voodoo
    Rhythm which is put in at the end of the second paragraph.
    I have several of these to do hence hoping to find a quick
    way of input. Any Idea's would be appreciated.
    Cheers

    ps thanks for pointing me in the right direction for VBA.
     
    >-----Original Message-----
    >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: Grant: "Re: Cannot get rid of footnotes"

    Relevant Pages