Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open a TIF file

Status
Not open for further replies.

Dan8376

Technical User
Jan 29, 2002
25
US
I'm trying to open up a tif file with VB from an access form. I'm using the GetObject function, but I don't know the class name for the Windows Picture and Fax Viewer. (This is the default program to open TIF files with the Microsoft XP operating sysytem)

Here's what I'm trying right now, but its giving me a run time error '429'.

Sub xOpenFile()
Dim oTif As Object
Set oTif = GetObject("C:\Documents and Settings\DANIEL\00000026.tif", "shimgvw.application")
oTif.Visible = True
End Sub

If I know the correct class name to use I should be fine. Does anyone know the class name?

Thanks
Daniel
 
You may try something like this:
Set S As Object
Set S = CreateObject("WScript.Shell")
S.Run Chr(34) & "C:\Documents and Settings\DANIEL\00000026.tif" & Chr(34)
Set S = Nothing

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Wow, within 5 minutes you replied with a solution. Thanks for solving my problem. Thanks PH.
 
Glad an erroneous post solved your issue.
Replace this:
Set S As Object
By this:
Dim S As Object

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 

Yes, I was able to quickly identify the error and replace set with Dim. Thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top