Unanswered: Automating Imaging for Windows from Access
I'm trying to make Imaging for Windows jump through a few simple hoops from Access 2000 on Windows 2000. However, I can't seem to get the application object assigned to a variable. MS has a lovely object model complete with properties, methods and sample code. Unfortunately the most basic step doesn't work for me:
Dim app as object
set app = createobject("IWangImagemaging.Application")
This fails with Err #429 "Active X component cannot create object." What's it missing?
I've also tried
Set app = CreateObject("Imaging.Application") since I found this syntax elsewhere in the MS Library.
Have I missed a reference? Does it need more information?
OK, well this was really painful but in the end it worked in Windows 2000!
Here's the code for any fellow sufferers who come after me:
Dim ctl As Control
Dim app As Object
Dim imgFile As Object
Dim prn As Long
Set ctl = Me!oleAttachment
ctl.Action = acOLEActivate
Set app = CreateObject("Imaging.application")
Set imgFile = app.createimageviewerobject(1)
imgFile.saveCopyas ("C:\Access Links\Yippee.tif")
prn = imgFile.Print(False) 'Go figure
Set app = Nothing
Set imgFile = Nothing
Don't know why you don't use GetObject since the app is running once you run ctl.Action = acOLEActivate
Must use SaveCopyAs, SaveAs errors out.
Never seen anything that prints by setting a long variable to object.print before. Guess I don't get out much.
I'll be using this to 'automagically' print the OLE images as well as initially to convert embedded (don't blame me, I didn't do it) fields to linked fields in the database. If you need more code for this, email me!
Yes, but it requires the application of captial budget $ (as opposed to my salary budget $). Hence, it was not an option.
The code I posted previously worked for Win2K and I was able to get all .tif files to .pdf.
Then we moved everyone to a Terminal servered environment with everyone on office XP. Adobe Acrobat coughed up a hairball over it. Now, to print, I use Shell but have to specify the default printer. Oye! what a headache!