Results 1 to 3 of 3

Thread: call an outside application

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2000
    Posts
    138
    I have used the following codes in a VB6.0 program to call Winword.exe to open a word document but, to my surprise, they work quite well in my source codes directory (without any spaces in between) but after compiled and published and installed into the default directory C:\Program Files\¡* (with a space in between)

    strWordDir = ¡°C:\Program Files\Microsoft Office\Office¡±
    strDocFile = App.Path & ¡°\MyFile.doc¡±
    Shell strWordDir & ¡°\Winword.exe ¡° & strDocFile, vbMaximizedFocus

    The result of running the above codes is Word¡¯s report:

    Can¡¯t find the files Program.doc and Files\¡*\MyFile.doc
    (Presented in two separate DialogBoxes)

    It seems that my codes in the new directory (with a space) now uses the space as a separator for two document files. Can anyone tell me why and how to improve?


  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    'you could try this on your string

    'replace function in VB6
    'find an instance and replace it with another

    ''
    string1 = "my name is somewhere to be found!"
    string2 = Replace(string1, " ", "")


    'String1 is now "mynameissomewheretobefound!"


    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Sep 2000
    Posts
    138

    Thanks

    Hi, HeSaidJoe,
    You do have an interesting name. Why HeSaidJoe? Why not IHailJoe?
    I'll certainly try your suggestion which I believe most effective. I am looking forward to the result. When the result comes out, I'll write to you again.
    Thank you very much.
    Best wishes.
    IHailJoe --xmin

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