How do I determine Class property 
Author Message
 How do I determine Class property

Does anyone know how I can retrieve the Class property of
an embedded OLE object via VBA from the form code.

It seems from the on-line documentation that the 'Class'
property can be retrieved as a string from the object.

In my code below I have a field called 'image' that is an
OLE object (this code is from the form). Whenever I run it
I get a blank string returned from '[image].Class'

Any ideas?
----------------------------------------------
Private Sub btnSave_Click()
    Dim classText As String

    classText = [image].Class
    MsgBox ("Here's the class: " & classText)
    DoCmd.RunCommand (acCmdSave)

End Sub
-----------------------------------------------



Sat, 03 Apr 2004 01:39:29 GMT  
 How do I determine Class property
All registered clas properties are visible in the object browser.


Quote:
> Does anyone know how I can retrieve the Class property of
> an embedded OLE object via VBA from the form code.

> It seems from the on-line documentation that the 'Class'
> property can be retrieved as a string from the object.

> In my code below I have a field called 'image' that is an
> OLE object (this code is from the form). Whenever I run it
> I get a blank string returned from '[image].Class'

> Any ideas?
> ----------------------------------------------
> Private Sub btnSave_Click()
>     Dim classText As String

>     classText = [image].Class
>     MsgBox ("Here's the class: " & classText)
>     DoCmd.RunCommand (acCmdSave)

> End Sub
> -----------------------------------------------



Sat, 03 Apr 2004 04:08:11 GMT  
 How do I determine Class property
Hi,

I have a table "tblImage" with a field containing the full path to a
bitmap image on my hard drive (.gif, .jpg or bmp).

       Table: tblImage
       ------------------------
       Field Name: filename
          Data Type: Text
          Field Size: 255
       Field Name: image
          Data Type: OLE Object

I want to add the actual bitmap data to a field in the same table.

Using the AutoForm: Columnar Wizard, create a new form based on the tblImage
table. Save it as frmImageLoad.
Open the frmImageLoad form in Design view.
Type the following event procedure in the OnLoad property of the
frmImageLoad form:

Private Sub Form_Load()
    Do While Me!filename > ""
          Select Case Right(Me!filename, 3)
          Case "jpg"
            [image].Class = "jpegfile"
          Case "gif"
            [image].Class = "giffile"
          Case "bmp"
            [image].Class = "Paint.Picture"
          End Select
          [image].OLETypeAllowed = acOLEEmbedded
          [image].SourceDoc = [filename]
          [image].Action = acOLECreateEmbed
         DoCmd.RunCommand acCmdRecordsGoToNext
    Loop
End Sub

Save the frmImageLoad form and open it in Form view.
All files that match the [filename] you entered are added to the tblImage
table.

Please see the following article in the Microsoft Knowledge Base:
Q158941 ACC: How to Load OLE Objects from a Folder into a Table
http://support.microsoft.com/support/kb/articles/q158/9/41.asp

So long!
Serge Gavrilov.
http://accesstools.narod.ru


Quote:
> Does anyone know how I can retrieve the Class property of
> an embedded OLE object via VBA from the form code.

> It seems from the on-line documentation that the 'Class'
> property can be retrieved as a string from the object.

> In my code below I have a field called 'image' that is an
> OLE object (this code is from the form). Whenever I run it
> I get a blank string returned from '[image].Class'

> Any ideas?
> ----------------------------------------------
> Private Sub btnSave_Click()
>     Dim classText As String

>     classText = [image].Class
>     MsgBox ("Here's the class: " & classText)
>     DoCmd.RunCommand (acCmdSave)

> End Sub
> -----------------------------------------------



Sat, 03 Apr 2004 06:31:03 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Exposing Properties collection in custom classes as many MS Classes do

2. Exposing a Properties collection in custom classes as many MS Classes do

3. Properties Property for a Custom Class

4. Can a class property have properties?

5. Determining when a file's done with Winsock

6. Can a class property have properties?

7. Has anyone done a yEnc class for VB?

8. Cannot access fields using recordset property when doing a self-join

9. Optional Property Parameters: Can it be done?

10. Determine Obj Name on Class Initialisation

11. Determining the Class type from an Interface

12. determining CPU class & speed

 

 
Powered by phpBB® Forum Software