View Full Version : Windows Image and Fax Viewer (Preview 1.0) problem


chris-uk-lad
03-04-2009, 06:25 AM
Hi all, im trying to use thi but it doesnt seem to want to work for me.
I added the control (shimgvw.dll) but when i use the command everyones been suggesting on other posts

Preview1.ShowFile "<file path>", 1

I just get the error of 'Object Required'

The properties in the control (of which i find important) state:
Name - ActiveXCtl79
OLE Class - Preview class
Class - Preview.Preview.1

What am i doing wrong?

Many Thanks

HiTechCoach
03-04-2009, 07:25 AM
In your code you as using the object name are "Preview1".

Preview1.ShowFile "<file path>", 1

If the objects name's is really ActiveXCtl79, then try this:

ActiveXCtl79.ShowFile "<file path>", 1

chris-uk-lad
03-04-2009, 08:38 AM
I did trychanging the name of the control to Preview1 to comply and it still didnt work :(

HiTechCoach
03-04-2009, 10:37 AM
Would it be possible for you to post your actual VBA code.

The code you are posting doe not have a valid file path. It just has "<file path>"

How are you inserting the actual path to the file?

chris-uk-lad
03-04-2009, 11:47 AM
my app is at university atm, but ive just recreated it, on form load, as

Preview1.ShowFile "C:\My Documents\Picture\Sunset.jpg, 1

the websites ive read on the Preview 1.0 Type Library dont really mention details on adding the class, just on the code in the tool. I cant imagine ive added it incorrectly.

chris-uk-lad
03-05-2009, 12:21 AM
Just tried a few more times and to no success, trying to find if theres an OCX to it as shimgvw.dll is the only thing i think is registered. I get the error (when checking in properties)


A problem occured while db1 was communicating with the OLE server or ActiveX control.
Close the OLE server and restart it outside of db1. Then try the original operation again inside db1.


Any thoughts?

HiTechCoach
03-05-2009, 06:50 AM
I have never used that control before. I did a little googling and only found a post where it was tired with VB not Access.

I will put together a little test and let you know what I figure out.