Q: OLE Container and Database OLE object field 
Author Message
 Q: OLE Container and Database OLE object field

Does anyone know how to assign an OLE object to an OLE container through code.
I have a database field with an Embedded Word Document in it and we are trying
to stay away from the Data Control (for certain reasons.) I am using VB4.

Thanks for any help.

Travis



Sun, 20 Sep 1998 03:00:00 GMT  
 Q: OLE Container and Database OLE object field
Quote:

>Does anyone know how to assign an OLE object to an OLE container through code.
>I have a database field with an Embedded Word Document in it and we are trying
>to stay away from the Data Control (for certain reasons.) I am using VB4.

Travis, I've built a small Access database to store a bunch of word documents.
I took me a while to figure out why no one could get the object into the container.
Here's a code snipit that I assign to a button to import the document into a Forms
OLE container that is bound to an Access OLE database field. DocObject is the
OLE field & OlePath is just a string field that holds the fully qualified path & name of
the .DOC file that I wish to template the object from. The secret is to set Action to
OLE_ACTIVATE after setting all your other parameters. This tells the OLE Object
"Make It So".  Change the OLE_CREATE_EMBED to OLE_CREATE_LINK for defining
Object Links instead of Embeds.

'import an ole object into DocObject as an embedded OLE
[DocObject].SourceDoc = [OlePath].value         '  ex:  "C:\mydir\mydoc.doc"
[DocObject].Action = OLE_CREATE_EMBED  '  or use OLE_CREATE_LINK
[DocObject].Action = OLE_ACTIVATE                 '  make it so. The Picard command.




Thu, 24 Sep 1998 04:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. moving objects from OLE control to OLE field in jet database

2. Loading Word document from Access OLE field into OLE container control in VB

3. Loading Word document from Access OLE field into OLE container control in VB

4. Loading Word document from Access OLE field into OLE container control in VB

5. VBA-assigning an OLE-object to an Ole-object-field

6. moving data in OLE Container to Database Field

7. Database field in OLE container

8. Inserting an OLE object into an OLE field!!!!

9. Linking or Embedding an OLE object into an Access OLE DataType Field using DAO

10. Linking or Embedding an OLE Object in an Access OLE DataType Field using DAO

11. Insertion of OLE-Object into OLE-Field of Access-Table

12. storing an OLE object into an Access OLE field

 

 
Powered by phpBB® Forum Software