Results 1 to 7 of 7

Thread: Error using Mid() function???

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2001
    Location
    New York
    Posts
    165

    Error using Mid() function???

    Hi,

    When using the mid() function in MS Word 97 VBA I get the following error:

    "Cannot find project or library"

    Am i missing any project references?

    Does anybody know how to write a mid() function?

    Any ideas??

    Thanks

  2. #2
    Hyperactive Member
    Join Date
    Sep 2001
    Location
    Europe
    Posts
    289
    Mid(String, Start, Length), in VB 6.0 at least.

    Mike

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Aug 2001
    Location
    New York
    Posts
    165

    That is what I am using

    Well, that is what I am doing Mid(String, Start, Length), except I am still receiving the same error???

  4. #4
    Hyperactive Member schuurke28's Avatar
    Join Date
    Feb 2001
    Posts
    402
    sText="this is a sample text"
    myVariable = mid(sText, 6,2)
    ' myVariable will be "is"

    u don't need any reference at all

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Aug 2001
    Location
    New York
    Posts
    165

    Maybe it is another issue...

    Well, the weird thing is, it works ok on my machine, however, on my colleague's maching he receives the error.

    I didn't think it was the reference thing, so I guess it must be something else.

  6. #6
    Hyperactive Member schuurke28's Avatar
    Join Date
    Feb 2001
    Posts
    402
    i've checked the references word uses (standard references):
    - Visual Basic for Applications
    - Microsoft word 9.0 Object library
    - ole automation
    - normal
    - microsoft office 9.0 object library

    maybe you could check these? (! i'm using word 2000!)

  7. #7
    larryn
    Guest
    reference it directly like this:

    VBA.Mid$(String, Start, Length)

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