Windows Image and Fax Viewer (Preview 1.0) problem

chris-uk-lad

Registered User.
Local time
Today, 09:40
Joined
Jul 8, 2008
Messages
271
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

Code:
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
 
In your code you as using the object name are "Preview1".

Code:
[b]Preview1[/b].ShowFile "<file path>", 1

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

Code:
[b]ActiveXCtl79[/b].ShowFile "<file path>", 1
 
Last edited:
I did trychanging the name of the control to Preview1 to comply and it still didnt work :(
 
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?
 
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.
 
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)

Code:
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?
 
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.
 

Users who are viewing this thread

Back
Top Bottom