paulo72
asked on
Insert a file in a bound object frame
I want to insert a file ex. "c:\123.doc", in a automatic way, in i a bound object frame.
I have a record number, example 123, where I input various infos, then in this record (table) I need to insert (OLE) a file, but I don't want to use the keyboard or the mouse to do it. I want that this is made automatic.
Can you help me? The dabase picks the file in the positions identified by me and thens inserts it in the object frame.
Thanks,
Paulo Marques
I have a record number, example 123, where I input various infos, then in this record (table) I need to insert (OLE) a file, but I don't want to use the keyboard or the mouse to do it. I want that this is made automatic.
Can you help me? The dabase picks the file in the positions identified by me and thens inserts it in the object frame.
Thanks,
Paulo Marques
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi svenkarlsen
again the same thing, I have to become faster :-(
Create/use a table with an "OLE Object" type field.
design a form and insert a <Bound Object Frame> named eg "OLEFile" and a <textbox> named eg "txt1" for the filename and a <command button> named eg "Command1".
define a commandhandler for Button1 and write :
Private Sub Command1_Click()
[OLEFile].Class = "Word.Document"
[OLEFile].OLETypeAllowed = acOLEEmbedded
[OLEFile].SourceDoc = [txt1]
[OLEFile].Action = acOLECreateEmbed
DoCmd.RunCommand acCmdRecordsGoToNew
End Sub
now the file is saved in the database.