PDA

Click to See Complete Forum and Search --> : Split in word macro *resolved*


CornedBee
Jun 24th, 2003, 01:55 AM
Hi

I usually never use VB, but now I need to write a macro for Word. The macro should provide a form that lets the user choose one of several words in the text.

I have the text I need in a String, now I need to split it into the words. So I wrote this:

Dim s As String
Dim subs() As String
' get value into s
...
' now split
subs = Split(s, "/")


However it tells me that it doesn't know the symbol "Split". Isn't it a built-in function?

Thanks in advance

MileOut
Jun 24th, 2003, 03:05 AM
I believe that Split() has been a function since Office 2000, meaning that, if you are using Word '97, you'll have to go another way around it.

i.e. loop through the text and use the Instr() function to put ll the different words into an array.

CornedBee
Jun 24th, 2003, 05:07 AM
I use 97, so it seems you're right. Thanks, I'll write my own. (Can't upgrade, there's some real stupid buerocrazy going on...)

Unless someone already has one?

CornedBee
Jun 24th, 2003, 06:43 AM
Found something on the web.