Group: microsoft.public.word.vba.general
From: Alan Stancliff
Date: Wednesday, February 27, 2008 7:28 PM
Subject: Re: Selecting Specific Range Within A Document Without Search (Word 2003)

Hi Jay,

Yes, I was hoping to avoid the screen from jumping around during the
performance of this task. I actually got the idea for the question by
studying an exchange of messages we had last month, which you can refer
to here:

Browser link:
http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.word.vba.general&tid=0e7336bb-59cf-4e33-99c8-c431abd8ef12&cat=en_US_eb67b351-9403-4888-a42c-b2b58efec0aa&lang=en&cr=US&sloc=en-us&m=1&p=1

Newsreader link:
news://msnews.microsoft.com:119/0E7336BB-59CF-4E33-99C8-C431ABD8EF12@microsoft.com

Regards,

Alan Stancliff


Jay Freedman wrote:
> My 2 cents... While Tony's answer is correct, using the search function is MUCH
> faster and easier than any other method. If you can think of a good reason not
> to use it, I'd like to hear about it.
>
>
> On Thu, 28 Feb 2008 00:00:13 -0000, "Tony Jollans" > dot com> wrote:
>
>> Without using (built-in) search functionality you will have to write your
>> own - checking each paragraph (using any algorithm you like) until you
>> identify the one you want.
>>
>> Having identified the paragraph you can scan it and move the selection
>> within it using Selection.MoveUntil and Selection.MoveEndUntil and other
>> similar methods.
>>
>> --
>> Enjoy,
>> Tony
>>
>> "Alan Stancliff" wrote in message
>> news:eDX4fgZeIHA.5400@TK2MSFTNGP04.phx.gbl...
>>> Here's a Word 2003 VBA question about RANGEs that's been driving me nuts
>>> for a while.
>>>
>>> Supposing I have a document that somewhere has the following on a line by
>>> itself, effectively being a paragraph:
>>>
>>> **********
>>> (A) MY SAMPLE WORDS TO SELECT: Hello World
>>>
>>> and later on it has a line that has
>>>
>>> (B) MY OTHER SAMPLE WORDS TO SELECT: Hello Universe, So Vast Thou Art.
>>> *********
>>>
>>> Without using the search functionality, how would one code to do the
>>> following three tasks:
>>> 1. Select the the stuff following the colon and two spaces in sample (A),
>>> whatever it may be (in this case, "Hello World")
>>>
>>> 2. Select the stuff before the comma in my example (B), whatever it may be
>>> (in this case it is Hello Universe)
>>>
>>> 3 Select the stuff between the comma and end of the line (in this case, it
>>> is "So Vast Thou Art").
>>>
>>>
>>> Regards,
>>>
>>> Alan
>
> --
> 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.

Safety Articles | Usenet Groups | Usenet News | Bluegrass