Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Display an Image in it's associated program

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Display an Image in it's associated program

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Display an Image in it's associated program

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
DISPLAY Image Based on Logic RayportingMonkey Excel Discussion (Misc queries) 5 July 25th 07 05:54 PM
How to hyperlink to an image on a different sheet and display it f twilliams New Users to Excel 1 February 10th 06 03:11 AM
Please help...display image if xx Borimard Excel Discussion (Misc queries) 0 August 31st 05 09:28 AM
Display Worksheet image on a form Dave Taylor[_4_] Excel Programming 0 November 18th 04 10:10 AM
Display Worksheet image on a form Dave Taylor[_3_] Excel Programming 1 November 18th 04 02:19 AM


All times are GMT +1. The time now is 06:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"