> Hi Jay,
>
> Thanks for your help. This is pretty close. I just need to know what I can
> replace the .Execute Replace:=wdReplaceAll
> with so that it doesn't delete every instance in the document, just the
> first one it comes to. I tried wdReplace, but it didn't like that.
>
> Alan
>
>
> "Jay Freedman" <jay.freedman[ at ]verizon.net> wrote in message
> news:vdkl23dahr2nkafc8e4c49c22lk5sd9l98[ at ]4ax.com...
>> Hi Alan,
>>
>> I already gave you the macro code. You just have to put in the actual
>> markers for the start and end of the block, instead of the "StartText"
>> and "StopText" that I inserted as placeholders.
>>
>> If that isn't what you want, please let me know what part of its
>> behavior should be changed.
>>
>> --
>> Regards,
>> Jay Freedman
>> Microsoft Word MVP FAQ:
http://word.mvps.org>> Email cannot be acknowledged; please post all follow-ups to the
>> newsgroup so all may benefit.
>>
>> On Sat, 21 Apr 2007 20:52:22 -0400, "Alan B. Densky"
>> <sales[ at ]neuro-vision.us> wrote:
>>
>> >Hi Jay,
>> >
>> >Thanks for your help. I do need to do it in a macro. I'll tell you
> exactly
>> >what I'm doing, and then you'll understand.
>> >
>> >I write articles that I submit to article directories to market my
> website.
>> >The submission rules for every article directory are different, but they
>> >basically fall into two groups:
>> >
>> >1. Directories that allow you to have links in your article's body
>> >2. Directories that DO NOT allow you to have links in your article's
>> >body
>> >
>> >I write the article without links, and then write a block of text (a
> couple
>> >of paragraphs) that does have links. I mark the start and the end of the
>> >block that doesn't have links, and I mark the start and the end of the
> block
>> >that does have links.
>> >
>> >My articles are spun, that is - each article is setup into a seed
>> >article
>> >format that has hundreds of synonomous words and phrases. The article
>> >spinning software spins out hundreds of variations of the article into
> one
>> >long document. Each version of the article is a minimum of 30% different
>> >from every other version. No mind you, they all say the same thing, but
> they
>> >use different words.
>> >
>> >Since each version of the article is different, each block (either with
> or
>> >without the links) varies in length. So I need to be able to search for
> the
>> >beginning and the ending of each block that is to be deleted. Merely
>> >counting lines with a down arrow is not nearly accurate enough.
>> >
>> >This allows me to submit a different and unique version of each article
> to
>> >every article directory. This is to escape the Google duplicate content
>> >filters.
>> >
>> >Now, as I visit each article directory, I advance to the next version of
> the
>> >article in the document, and I run the appropriate macro which finds
> either
>> >the block of text that has links, or the block of text that doesn't have
>> >links, and it deletes the appropriate block to prep the article based on
> the
>> >requirements of the specific article directory.
>> >
>> >This happens hundreds of times. Manually finding and deleting each of
> these
>> >blocks of text is tedius and very time consuming.
>> >
>> >So hopefully now that you understand why I need to be able to find
> certain
>> >blocks and select them for deletion, you will give me the info that I
>> >requested.
>> >
>> >As far as using the find dialog, or using it and recording it in a
>> >macro,
>> >I've been doing that for many, many years.
>> >
>> >Thanks,
>> >Alan
>> >
>> >
>> >
>> >
>> >
>> >"Jay Freedman" <jay.freedman[ at ]verizon.net> wrote in message
>> >news:l4ui231s1e7fjvqvtptahaett8ehg2q4ji[ at ]4ax.com...
>> >> A macro isn't really necessary, unless you need to do the same thing
>> >> repeatedly. All you need is a wildcard replace. The theory and
>> >> background are at
http://www.gmayor.com/replace_using_wildcards.htm.>> >>
>> >> Since you didn't reveal the magic text of the start and stop markers,
>> >> I'll simulate them with "StartText" and "StopText".
>> >>
>> >> - Open the Replace dialog, click the More button, and check the "Use
>> >> wildcards" box.
>> >>
>> >> - In the Find What box, enter
>> >>
>> >> (StartText)(*)(StopText)
>> >>
>> >> - In the Replace With box, if you want to keep the StartText and
>> >> StopText markers, enter the code
>> >>
>> >> \1\3
>> >>
>> >> If you want the whole thing to disappear including the markers, leave
>> >> the Replace With box empty.
>> >>
>> >> - Click the Replace All button.
>> >>
>> >> As a macro, the procedure should be coded like this:
>> >>
>> >> Sub demo()
>> >> Dim oRg As Range
>> >> Set oRg = ActiveDocument.Range
>> >> With oRg.Find
>> >> .ClearFormatting
>> >> .Replacement.ClearFormatting
>> >> .Text = "(StartText)(*)(StopText)"
>> >> .Replacement.Text = "\1\3"
>> >> .Format = False
>> >> .MatchWildcards = True
>> >> .Wrap = wdFindContinue
>> >> .Execute Replace:=wdReplaceAll
>> >> End With
>> >> End Sub
>> >>
>> >> --
>> >> Regards,
>> >> Jay Freedman
>> >> Microsoft Word MVP FAQ:
http://word.mvps.org>> >> Email cannot be acknowledged; please post all follow-ups to the
>> >> newsgroup so all may benefit.
>> >>
>> >> On Fri, 20 Apr 2007 15:33:13 -0400, "Alan B. Densky"
>> >> <sales[ at ]neuro-vision.us> wrote:
>> >>
>> >> >Hello,
>> >> >
>> >> >I'm using Word 2000.
>> >> >
>> >> >I am trying to write a macro that will delete a specifi parts of a
>> >document.
>> >> >
>> >> >A static text string that never changes is in the document and it
> marks
>> >the
>> >> >BEGINNING of the block that I want to select and delete.
>> >> >
>> >> >A static text string that never changes is in the document and it
> marks
>> >the
>> >> >END of the block that I want to select and delete.
>> >> >
>> >> >The amount of text between the starting point and the ending point
> (that
>> >I
>> >> >want to delete) varies with each document.
>> >> >
>> >> >I need to be able to somehow use the Edit | Find to find that ending
>> >string
>> >> >and then select all of the text between the starting point and the
> ending
>> >> >point.
>> >> >
>> >> >Does anyone know how to do this? If so, could you please write a
>> >> >macro
>> >and
>> >> >post it? I'm sure that I could take your code and insert it into the
>> >macro
>> >> >editor and make the other changes that I need.
>> >> >
>> >> >Thank you,
>> >> >
>> >> >Alan
>> >> >
>> >
>
>