Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello. I've got a program that displays a thumbnail picture of a house's
floorplan within a Userform, based on the house selected by the user. What I'd like to do is allow the user to double click on the image and have it open up in the user's default image viewer, so they might view, edit or print the floor plan out. After 2 hours of searching, all I've come up with is the fact that I might be able to do it with the Shell command but I don't know if that will work unless I declare the location of the picture viewers exe... which can obviously changed based on the user's PC. Any guidance would be very appreciated. Thank you very much for your time! CB Hamlyn |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
From: Jim Rech )
Subject: Shell command View this article only Newsgroups: microsoft.public.excel.programming Date: 2000/01/14 I don't believe Shell has the capability to run by association, Patrick, but it's a good thought. There is an API that does run by association though: 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 Global Const SW_SHOWNORMAL = 1 Sub a() ShellExecute 0, "Open", "c:\Anyfile.txt", "", "C:\", SW_SHOWNORMAL End Sub -- Regards,Tom Ogilvy"CB Hamlyn" wrote in message ... Hello. I've got a program that displays a thumbnail picture of a house's floorplan within a Userform, based on the house selected by the user. What I'd like to do is allow the user to double click on the image and have it open up in the user's default image viewer, so they might view, edit or print the floor plan out. After 2 hours of searching, all I've come up with is the fact that I might be able to do it with the Shell command but I don't know if that will work unless I declare the location of the picture viewers exe... which can obviously changed based on the user's PC. Any guidance would be very appreciated. Thank you very much for your time! CB Hamlyn |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I had to make the declarations private, but other than that it works
perfectly. Thank you so much Tom :) CB Hamlyn "Tom Ogilvy" wrote in message ... From: Jim Rech ) Subject: Shell command View this article only Newsgroups: microsoft.public.excel.programming Date: 2000/01/14 I don't believe Shell has the capability to run by association, Patrick, but it's a good thought. There is an API that does run by association though: 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 Global Const SW_SHOWNORMAL = 1 Sub a() ShellExecute 0, "Open", "c:\Anyfile.txt", "", "C:\", SW_SHOWNORMAL End Sub -- Regards,Tom Ogilvy"CB Hamlyn" wrote in message ... Hello. I've got a program that displays a thumbnail picture of a house's floorplan within a Userform, based on the house selected by the user. What I'd like to do is allow the user to double click on the image and have it open up in the user's default image viewer, so they might view, edit or print the floor plan out. After 2 hours of searching, all I've come up with is the fact that I might be able to do it with the Shell command but I don't know if that will work unless I declare the location of the picture viewers exe... which can obviously changed based on the user's PC. Any guidance would be very appreciated. Thank you very much for your time! CB Hamlyn |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
DISPLAY Image Based on Logic | Excel Discussion (Misc queries) | |||
How to hyperlink to an image on a different sheet and display it f | New Users to Excel | |||
Please help...display image if xx | Excel Discussion (Misc queries) | |||
Display Worksheet image on a form | Excel Programming | |||
Display Worksheet image on a form | Excel Programming |