Solved

Insert a file in a bound object frame

Posted on 2003-11-10
3
744 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…

751 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