Results 1 to 3 of 3

Thread: Get/SetObjects

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

    Get/SetObjects

    I need to create an instance of NotePad from within Access97. The syntax appears to be straightforward but so far I've been unsuccessful. Does anyone know of a resource that lists the object types that are available from various applications (more than just MS would be really nice) or, even better, a way to examine an application to determine what objects it supports.

    Right now the client just wants NotePad but AutoCAD and picture viewers won't be far behind

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Get/SetObjects

    Here's how you call Notepad.

    <pre>Private Sub cmdNotePad_Click()
    On Error GoTo Err_cmdNotePad_Click
    Dim varReturn As Variant

    'launch notepad and get the handle value
    varReturn = Shell("NOTEPAD.EXE", 1)

    Exit_cmdNotePad_Click:
    'this just shows you the value returned from the
    'shell function. You could use this to reference
    'the notepad window
    MsgBox varReturn
    Exit Sub

    Err_cmdNotePad_Click:
    MsgBox Err.Description
    Resume Exit_cmdNotePad_Click

    End Sub</pre>

    Charlotte

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

    Re: Get/SetObjects

    Thanks for the feedback Charlotte. I had looked at Shell before but I need to be able to create a file in a specific directory (and also create the directory structure if necessary). I had hoped to be able to avoid the overhead of a .doc file but I guess I'll just have to bite the bullet.

Posting Permissions

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