Results 1 to 4 of 4

Thread: Split in word macro *resolved*

Hybrid View

  1. #1

    Thread Starter
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Split in word macro *resolved*

    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:
    VB Code:
    1. Dim s As String
    2. Dim subs() As String
    3. ' get value into s
    4. ...
    5. ' now split
    6. 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
    Last edited by CornedBee; Jun 24th, 2003 at 06:43 AM.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  2. #2
    Lively Member MileOut's Avatar
    Join Date
    Nov 2001
    Location
    Glasgow
    Posts
    83
    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.

  3. #3

    Thread Starter
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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?
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  4. #4

    Thread Starter
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Found something on the web.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width