Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    Jan 2001
    Location
    Chatham, Ontario, Canada
    Posts
    86
    Thanks
    5
    Thanked 1 Time in 1 Post

    GetObject 97 SR-2

    This one is going to make me crazy. To quote from the help file:
    Dim CADObject As Object
    Set CADObject = GetObject("C:CADSCHEMA.CAD")

    When this code is executed, the application associated with the specified pathname is started and the object in the specified file is activated.

    When I try to open a .txt file I get "File name or class name not found".
    The file name is correct
    Notepad will open it when double clicked in Explorer so I assume that the association is correct
    If I understand the help file then I've got the elements that I need to succeed yet it fails.

    Help!

  2. #2
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    The Netherlands
    Posts
    216
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: GetObject 97 SR-2

    If you want the application a file is associated with being started you can use the followhyperlink method of the application object. Check Access Help for all the possibilities of the followhyperlink method.

  3. #3
    Star Lounger
    Join Date
    Jan 2001
    Location
    Chatham, Ontario, Canada
    Posts
    86
    Thanks
    5
    Thanked 1 Time in 1 Post

    Re: GetObject 97 SR-2

    Interesting approach. Thank you, I'll look into it. In the meantime I just made a scratch table with a memo field and I'm writing the text file in and out of that.

  4. #4
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    The Netherlands
    Posts
    216
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: GetObject 97 SR-2

    I took a look in one of my applications.
    I used it like this:
    Application.FollowHyperlink strPathDoc, , True, False
    strPathDoc contains the path and the name of random document.
    Can be a text file, a html file, word document, etc.
    Doesn't matter what kind of a file, the associated application will be started and the file will be loaded.

Posting Permissions

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