Help w/ oApp ImageViewer

P

Pierre

Can I please get some help with this code. I would like to click on a picture
and have it open in Windows Image Viewer.

Private Sub Image501_Click()
If vbYes = MsgBox("Would you like to view the image " 7 _
"in the Image Viewer?", vbQuestion+vbYesNo+vbDefaultButton1, _
"View Image?") Then
Dim oApp As Object
Set oApp = CreateObject ("unsure_what_ImageViewer_Is.Application")
oApp.Visible = True
oApp.Documents.Open "T:\\name\anothername\[txtbox_with_imagename]
End If
 
T

TonyT

Can you not use the after update event of your textbox to set the
hyperlinkAddress value of the image to that of the picture you wish to view
and then let the default photo application open the image?

eg.

Private Sub texbox_with_imagename_AfterUpdate()
me.Image501.HyperlinkAddress = "T:\\name\anothername\" &
Me.textbox_with_imagename

you could then just click the image.

TonyT..
 
P

Pierre

I guess I was just thinking too much into it. Thank you for that vary simple
salutation to a big headache.
--
Work is sometimes hard....but someone has to do it.


TonyT said:
Can you not use the after update event of your textbox to set the
hyperlinkAddress value of the image to that of the picture you wish to view
and then let the default photo application open the image?

eg.

Private Sub texbox_with_imagename_AfterUpdate()
me.Image501.HyperlinkAddress = "T:\\name\anothername\" &
Me.textbox_with_imagename

you could then just click the image.

TonyT..

Pierre said:
Can I please get some help with this code. I would like to click on a picture
and have it open in Windows Image Viewer.

Private Sub Image501_Click()
If vbYes = MsgBox("Would you like to view the image " 7 _
"in the Image Viewer?", vbQuestion+vbYesNo+vbDefaultButton1, _
"View Image?") Then
Dim oApp As Object
Set oApp = CreateObject ("unsure_what_ImageViewer_Is.Application")
oApp.Visible = True
oApp.Documents.Open "T:\\name\anothername\[txtbox_with_imagename]
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top