Help w/ oApp ImageViewer

  • Thread starter Thread starter Pierre
  • Start date Start date
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
 
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..
 
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
 
Back
Top