+ Reply to Thread
Results 1 to 12 of 12

How to open .jpg picture with macro

Hybrid View

  1. #1
    Valued Forum Contributor
    Join Date
    09-04-2007
    Location
    Ontario, Ca
    Posts
    624

    Re: How to open .jpg picture with macro

    Good Morning SHG

    Your code works, but I would like to better understand the code.

    Could you explain to me how this line of code works or the meanings of code please:

    RetVal = ShellExecute(0&, "open", PicPath, 0&, 0&, 1)
    Thanks for helping . . .
    Matt @ Launchnet

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: How to open .jpg picture with macro

    Hello Matt,

    I will keep it simple because this is a low level system call. Explaining how all the arguments function and where they come from is too much detail to explain in this post.

    The ShellExecute code is an API (Applications Programming Interface) call. The procedure will open the executable program associated with the file's extension. This call uses uses the verb "open" to run the executable program for the file's type. The file, including the path and the file extension, is the third parameter. The last parameter determines the window state when the program is run. Normal size is chosen.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: How to open .jpg picture with macro

    Good Morning SHG

    Your code works ...
    Leith's code, Matt
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Valued Forum Contributor
    Join Date
    09-04-2007
    Location
    Ontario, Ca
    Posts
    624

    Re: How to open .jpg picture with macro

    Good Morning Leith

    RetVal = ShellExecute(0&, "open", PicPath, 0&, 0&, 1)
    I understand RetVal = ShellExecute( ?, "open, PicPath, ?, ?, ?)

    Is their an easy explaination of the areas with question marks ? In general, what they mean.

    If not, forget it, as I understand where you are coming from.

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: How to open .jpg picture with macro

    Hello Matt,

    Click on this link to see a full explanation of the call.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1