I have a string (strSentence) that my code has copied off the Word document
and I know that it’s setup with this format:
John & Jane Doe <tab>Jim, Anne <tab> 1,2,3
The first part of the sentence is a name, either first & last or first,
wife, and last.
Then a tab
Then a sequence of one to four names separated by “,”
Then a tab
The a sequence of a few numbers separated by “,”
How can I programmatically break this down into the following 3 strings:
Name (everything before the first tab)
Children (everything between the tabs)
Number (everything after the second tab)
Thanks,
Ck
Tony Jollans - 30 Jan 2006 08:23 GMT
Try using Split (assuming you have at least Word 2000) ...
Dim Phrases ' must be defined as a variant
Phrases = Split(strSentence,vbTab)
Msgbox Phrases(0) ' so you can see what they are
Msgbox Phrases(1)
Msgbox Phrases(2)
--
Enjoy,
Tony
> I have a string (strSentence) that my code has copied off the Word document
> and I know that it's setup with this format:
[quoted text clipped - 14 lines]
> Thanks,
> Ck