Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Save Word Doc To OLE Object Using Code

Status
Not open for further replies.

aaahhhrrggghhhh

Programmer
Apr 5, 2002
61
IE
Hi all.

I have a word document (myworddoc.doc) on my hard drive and I have an access database. when I click on a button in the database on a form I created, it should take the word document and insert it into an OLE object field within the table MyTable, programmatically.

MyTable...

Id Autonumber
MyOLEField OLE Object

How can I achieve this? I am currently using DAO recordsets to insert it as the "Insert" SQL statement does not work with this. I tried the statement :

... declared object of type word.document, etc. mydoc now contains the word document

myRS.Fields("MyOLEField") = mydoc.ActiveWindow.Document.ActiveWindow.Application.ActiveDocument

however, when it is inserted, it goes in as a "long binary data" datatype. When I click on it, a msgbox appears saying "a problem occured while the system was communicating with the OLE server or activeX control". I have given up on trying to insert it this way.

Any offers??

Regards,
Mr Big.

PS. I cant use bound controls on my form as I have other stuff on there - would be too messy even with visible turned off. Dont be small. be BIG
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top