* Crossposted in VISUAL_BASIC
* Crossposted in MS_WORD
* Crossposted in WIN95
High! All,
I'm having trouble using MS Word 7 as an OLE automation server from MS
Access 7. This is what I'm trying to achieve:
- an Access table contains an OLE Data type field.
- when creating a new record, I'll have to manually insert a bound
(embedded) OLE object of the type MS Word Document.
- I'd like the bound OLE object to be automatically created and embedded
in the database.
I used the following approach.
- upon entering new information the BeforeInsert event is triggered.
This is an ideal time to fill fields with precalculated information.
'Cause someone suggested that the record might not yet exist I hooked
the code to the AfterUpdate event of the first text field, getting the
same 'result'
- This is the code I used for creating and embedding the object:
Static oDummy As Object
'a dim used too much stack space
Set oDummy = CreateObject ("Word.Basic")
'Word only supports the Basic object for OLE automation
oDummy.FileNewDefault
'to create a new document
Me![Article] = oDummy
'to put it in the field
The result was disappointing; CreateObject did not result in the
creation of an OLE object. That is it creates an error and puts the
result in oDummy. Starting Word beforehand showed that the
oDummy.FileNewDefault caused Word to start a new doc!
Me![Article] = oDummy ends up in an invalid page fault in OLEAUT32.DLL,
crashing Access in the process.
HELP!!! How can I create and embed an empty Word document in an Access
database field?
___ __ __
Happy programming, / | / /__/ /
___/ /| |/ ___ /
Jigal. /____/ |___/ /_/
--- Terminate 4.00/Pro
---------------
* Origin: Point 2 is a point too at Revolution Ballroom (2:281/721.2)
|