Results 1 to 11 of 11

Thread: open a file from app?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2000
    Location
    Dullawhere
    Posts
    100

    Question

    how can i open a file from an app?
    I am stupid..but I AM 15 !
    *a line from a song i wrote*
    """"""""""""""""""""""""""""""""""""""""
    so i came to say life bites away
    whats done is done the past is gone
    i cant believe the sh*t I know
    i always wish it would just go
    """"""""""""""""""""""""""""""""""""""""
    "remember you Ps And Qs Boy !"

  2. #2
    Hyperactive Member marnitzg's Avatar
    Join Date
    Oct 2000
    Location
    South Africa
    Posts
    372
    A little more detail please. i.e. Open a file for output, input. Open a file that is associated with another app???

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Aug 2000
    Location
    Dullawhere
    Posts
    100
    like, say i wanted to open the file " andrew.reg" by clicking on a command button
    I am stupid..but I AM 15 !
    *a line from a song i wrote*
    """"""""""""""""""""""""""""""""""""""""
    so i came to say life bites away
    whats done is done the past is gone
    i cant believe the sh*t I know
    i always wish it would just go
    """"""""""""""""""""""""""""""""""""""""
    "remember you Ps And Qs Boy !"

  4. #4
    Member
    Join Date
    Jul 2000
    Location
    Ontario, Canada
    Posts
    61
    Use the ShellExecute Function
    ---~^ Absalom ^~---

    There is nobody in the world who knows everything there is no one his/her workforce who knows everything what really makes the person smart is that he/she is not affraid to ask for help.

  5. #5
    Member
    Join Date
    Jul 2000
    Location
    Ontario, Canada
    Posts
    61
    The Code
    is
    put this in a module
    Code:
    Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
    Public Const SW_SHOWNORMAL = 1
    and put this in
    your command buttons click function
    Code:
    Call ShellExecute(hwnd, "Open", "c:\andrew.reg", "", "", 1)
    ---~^ Absalom ^~---

    There is nobody in the world who knows everything there is no one his/her workforce who knows everything what really makes the person smart is that he/she is not affraid to ask for help.

  6. #6
    Hyperactive Member tumblingdown's Avatar
    Join Date
    Mar 2000
    Posts
    362

    .reg

    be carefull with that file. ShellExecute can open a file with it's associated proggy. In the case of .reg, you might just go and change some reg keys.


    td.
    "One logical slip and an entire scientific edifice comes tumbling down." - Robert M. Pirsig


    tumblingdown@hotmail.com

    "but if Einstein is right and God is in the details, reality requires that we sometimes get religion." - Scott Meyers.

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Aug 2000
    Location
    Dullawhere
    Posts
    100
    cool thanx guys, i got another one thoug, how can i embed a file " andrew.reg" into the program so that it can be ruin on other computers without having to put the specific file in the specific directory?
    I am stupid..but I AM 15 !
    *a line from a song i wrote*
    """"""""""""""""""""""""""""""""""""""""
    so i came to say life bites away
    whats done is done the past is gone
    i cant believe the sh*t I know
    i always wish it would just go
    """"""""""""""""""""""""""""""""""""""""
    "remember you Ps And Qs Boy !"

  8. #8
    Member
    Join Date
    Jul 2000
    Location
    Ontario, Canada
    Posts
    61
    How did you embed the file into your proggy
    I want to do that in one of my progz
    if you find the way to do it that is
    ---~^ Absalom ^~---

    There is nobody in the world who knows everything there is no one his/her workforce who knows everything what really makes the person smart is that he/she is not affraid to ask for help.

  9. #9
    Hyperactive Member tumblingdown's Avatar
    Join Date
    Mar 2000
    Posts
    362
    Does the file contain reg entries?

    if so, why not just have the entries in your proggy, and alter the reg from code.



    td.
    "One logical slip and an entire scientific edifice comes tumbling down." - Robert M. Pirsig


    tumblingdown@hotmail.com

    "but if Einstein is right and God is in the details, reality requires that we sometimes get religion." - Scott Meyers.

  10. #10

    Thread Starter
    Lively Member
    Join Date
    Aug 2000
    Location
    Dullawhere
    Posts
    100
    how would i do that?
    I am stupid..but I AM 15 !
    *a line from a song i wrote*
    """"""""""""""""""""""""""""""""""""""""
    so i came to say life bites away
    whats done is done the past is gone
    i cant believe the sh*t I know
    i always wish it would just go
    """"""""""""""""""""""""""""""""""""""""
    "remember you Ps And Qs Boy !"

  11. #11
    Hyperactive Member tumblingdown's Avatar
    Join Date
    Mar 2000
    Posts
    362
    Depends on what you're trying to set/alter.

    VB has some simplistic built in stuff (GetSetting,SaveSetting etc) but you are limited to what/where you can alter - hkey_current_user\software\vb and vba program settings\

    If you want to be able to have full control then you have to use some api calls. Look at api calls like RegCreateKey, RegOpenKey etc. Have a search on the API Forum, there's tons of stuff.


    td.
    "One logical slip and an entire scientific edifice comes tumbling down." - Robert M. Pirsig


    tumblingdown@hotmail.com

    "but if Einstein is right and God is in the details, reality requires that we sometimes get religion." - Scott Meyers.

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