Solved

Insert a file in a bound object frame

Posted on 2003-11-10
3
712 Views
Last Modified: 2009-10-08
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

0
Comment
Question by:paulo72
  • 2
3 Comments
 
LVL 9

Accepted Solution

by:
svenkarlsen earned 125 total points
ID: 9714450
Hi paulo72,

Example:

If you make a form with a bound object frame called BF1 and a button, then put these lines in the OnClick event code of the button:

Me.BF1.Class = "Word.document"
Me.BF1.OLETypeAllowed = acOLEEmbedded
Me.BF1.SourceDoc = "c:\test.doc"
Me.BF1.Action = acOLEEmbed

This will insert the document c:\test.doc in the frame.


Kind regards,
Sven
0
 
LVL 4

Expert Comment

by:inox
ID: 9714578

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.
0
 
LVL 4

Expert Comment

by:inox
ID: 9714591

Hi svenkarlsen
again the same thing, I have to become faster   :-(
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ms/access ftp / SFTP 3 32
strange textbox behavior MS Access 9 34
Run Time Error 3071 26 36
ms/access webbrowser address not valid  - 12 26
Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now