OLE Class name assocaited with Microsoft Picture and Fax viewer

D

DanRoy

I was testing "How to Load OLE Objects from a Folder into a table, ACC2000.
There is a note to "see the documentation for the application supplying the
object to determine the Class Name of an OLE object."

I am using Visual Basic from within Access to open Microsoft Project, filter
a view and save a picture of the resultant view to a gif file. When I click
on the gif file, the file is opened by Microsoft picture and File viewer.
Within MS Picture and Fax Viewer is a Help icon, but no help is found for
OLE, Class, Class Name or anything else I can come up with.

Can someone provide a pointer to where I can look next? I have done queries
on Yahoo for""Visual Basic" "OLEClass" GIF and not yet found anything i can
use.

Dan


Can anyone tell me the correct OLE Class name to assocaite with the picture.
When I use the above referenced ACC2000
 
S

Stephen Lebans

Embed the object within your table. Then run the Inventory function of the
ExtractInventoryOLE solution on my site. If I remember correctly, it shows
the OLE Class name for each object. If it doesn't, just step through the
source code as it definately extracts the Class name.
http://www.lebans.com/oletodisk.htm
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
D

DanRoy

Stephen,

Thanks for your response but the information I got from usng your reply did
not answer my question nor did it allow me to successfully load the graphic
files from disk to my table.

I took ACC2000 and copied into my exisitng MDB application as a standalone
form and table. Using your application, I got a class name of OT_Static,
which did not help me in getting the ACC2000 form to successfully load the
graphic files.

So, I am now trying to convert the form-driven ACC2000 to a vb driven
Subroutine with little luck. I am doing this so I have the ability to step
through the code and watch what is happening in the immediate window. In
form mode, I cannot see what is happening as it steps through each line.

Here is my new module code:

Dim dbs As Database, rst As DAO.Recordset
Set dbs = CurrentDB
Set rst = dbs.OpenRecordset("tblLoadOLE")


Dim MyFolder As String
Dim MyExt As String
Dim MyPath As String
Dim MyFile As String
Dim StrCriteria As String

MyFolder = "C:\TEST"

MyPath = MyFolder & "\" & "*." & "GIF"
MyFile = Dir(MyPath, vbNormal)

Do While Len(MyFile) <> 0
With rst
.AddNew
.Fields("OLEPath") = MyFolder & "\" & MyFile
' Debug.Print rst!OLEPath

------ having trouble with these statements , which is why they are
commented out------
' MyFile.Class = "Paint.Picture"
'.Fields("Class.OLETypeAllowed") = acOLEEmbedded
'.Fields("class.SourceDoc") = MyPath
'.Filelds("class.action") = acOLECreatEmbed
' doCMD.RunCommand acCmdRecordsGoToNext
-------rest runs ok-----------
MyFile = Dir
.Update
End With
Loop
End Sub


Can you provide some insights as to how to complete the conversion. I think
I need to add some lines to define the properties of the OLE file i wish to
deefine before loading into the table but i do not know how to do that. (I
ams till usign the same table definition as was described in ACC2000
support.microsoft.com/kb/q198466 ).

Thank you for your help.

Dan
 
S

Stephen Lebans

The core issue here is that the MS Picture and Object Viewer application
CANNOT function as an OLE Image server. The result is that your Images are
inserted as class OT_STATIC. THis is basically an embedded BMP or Metafile.
To resolve your issue, you need to have an OLE Server capable application
that is setup and registered to handle GIF files on your system. Microsoft
Office Photo Editor is generally the app used in this situation.

Here is previous post of mine on how to ensure a specific app is registered
to handle/display a specific Image format.

MS Paint must be registered as the app to handle BMP files, not the WIndows
Picture/Fax viewer. I have seen cases in the NG's where MS Paint was the app
registered for BMP files but NOT as the OLE Server for BMP files.
Here is a thread on this topic. WHile it refers to MS Office Photo Editor
the logic is what you need to follow for MS Paint. Watch our for NG
linewrapping!

http://groups.google.ca/group/microsoft.public.access/browse_thread/t...



--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
S

Stephen Lebans

Sorry about that. Looks like a NG Linewrapp issue when I copied and pasted.
Here is a previous post of mine on this issue.

This issue pops up daily here.
An application has to be registered to insert and then later display the
embedded Image. You have obviously installed an application that has taken
over the registration for JPG Image files. You need to change this back to
the previous application that was functionaing correctly as an OLE Server
for JPG images.

The anwer to your second question, why are inserted JPG files smaller than
BMP files, is complex to say the least. In addition to storing an
uncompressed copy of the original BMP or JPG image, a preview of the Image
must be stored as well. This public preview Stream must be stored in a
standard uncompressed format(DIB). Finally, the OLE Server application can
store whatever it wants or requires within the private data field of the
embedded or linked OLE object. Some apps will compress the bitmap of the
original file as it lies within their private data Stream, but most do not.


If you need detailed info on the exact makeup of the Structured Storage OLE
objects see the OLE object Extraction tool on my site.


Here is a previous post of mine on a relevant issue:


The relevant Microsoft KB article is here:
http://support.microsoft.com/default.aspx?scid=kb;en-us;832508&Product=a


Images that are stored in OLE object fields do not appear correctly
View products that this article applies to.
Article ID : 832508
Last Review : May 3, 2005
Revision : 2.0


This article applies only to a Microsoft Access database (.mdb).


Novice: Requires knowledge of the user interface on single-user computers.
On This Page
SYMPTOMS
CAUSE
WORKAROUND
Install Microsoft Photo Editor
Display the images from a folder
MORE INFORMATION
Steps to reproduce the behavior
REFERENCES
SYMPTOMS
When you store an image file in a table as an OLE object in Microsoft Office
Access 2003, and then you try to display the stored image by embedding or by
linking the image file in a form, a report, or a data access page, you may
not be able to view the image. Additionally, you may notice that the file
icon displays the file name instead of the image itself.
Back to the top


CAUSE
This problem occurs because Access 2003 cannot find the OLE Server that can
correctly interpret the OLE object header information.
Back to the top


WORKAROUND
To work around this problem, use one of the following methods:
Back to the top


Install Microsoft Photo Editor
You can install Photo Editor from the Microsoft Office XP CD-ROM. To do
this, follow these steps: 1. Insert the Office XP CD-ROM in your CD-ROM
drive or in your DVD-ROM drive.
2. If the Office XP Setup program does not start automatically, follow
these steps: a. Click Start, and then click Run.
b. In the Run dialog box, type the following command in the
Open box:


<CD Drive>:\Setup.exe
c. Click OK.


3. Follow the instructions in the Office XP Setup Wizard.


Make sure that you select the customized installation.
4. When you reach the Selecting Features step, set each node of the
Setup tree to Not Available.
5. Under Features to install, expand Office Tools.
6. Click Microsoft Photo Editor, and then click Run from My Computer.
7. Click Install Now.
8. Click OK when the Office XP Setup program is completed
successfully.


Back to the top


Display the images from a folder
Instead of storing the images inside the table as OLE objects, you can store
the image file paths and the image names in the table and then display the
images by using an image control. When you use an image control inside a
form or a report, Access does not require the OLE Server to display the
images in the image control. For more information, click the following
article number to view the article in the Microsoft Knowledge Base:
285820 (http://support.microsoft.com/kb/285820/) How to display images from
a folder in a form, a report, or a data access page
Back to the top


MORE INFORMATION
When you install Microsoft Office 2003, the Setup program removes all the
standard components from Office XP (such as Photo Editor) that you
previously had installed on your computer. As a result, Access 2003 cannot
find the OLE Server that can display an image file (such as a .jpg file or a
..gif file), and you cannot view the embedded graphic files or the linked
graphic files.
Back to the top


Steps to reproduce the behavior
1. Start Access 2003.
2. Open the Northwind.mdb sample database.
3. In the Database window, click Tables under the Objects section.
4. In the right pane, double-click Create table in Design view.
5. Create a table that is named TestImage with the following details:


Table: TestImage
Field Name: FldImage
Data Type: OLE Object
6. Open the TestImage table in datasheet view.
7. In datasheet view, right-click the FldImage field, and then click
Insert Object.
8. Select Create from File, and then click Browse.
9. Locate the .jpg image file. Select the .jpg image file, and then
click OK.
10. Click OK.
11. On the File menu, click Close.
12. In the Database window, click Forms under the Objects section.
13. In the right pane, double-click Create form by using wizard.
14. In Form Wizard, select Table: TestImage from the Table/Queries
drop-down list.
15. Click >> to move all fields from the Available Fields list to the
Selected Fields list.
16. Click Finish.
17. If the form is not already open in form view, open the form in
form view.


Notice that when you view the data in the table in datasheet view, the
value of the OLE object is shown as a package image or as a bitmap image.
Additionally, when you view the form that displays the OLE object in form
view, the embedded image file does not appear. However, you can see the file
icon for the image file that is embedded in the form.


Back to the top


REFERENCES
For more information, click the following article number to view the article
in the Microsoft Knowledge Base:
817095 (http://support.microsoft.com/kb/817095/) Microsoft Photo Editor is
removed when you install Office 2003
Back to the top


---------------------------------------------------------------------------­­­-----


APPLIES TO
. Microsoft Office Access 2003



--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top