473,408 Members | 2,030 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

How to create a copy of object retrieved from bound object frame?

FishVal
2,653 Expert 2GB
Hi!

I have a table in my Access 2003 db containing OLE Object field with Word Document. What i want to do is to open an unbound copy of Document in MSWord application so the source in the table will remain intact and changes made to the Document will not be saved in the db.
I've not succeded to open the object through ADO recordset. The only solution seems to me is to access the object through Bound Object Frame control.

So the question is how can I make an independant copy of BoundObjectFrame.Object in order to close the form with source control?

Thanks.
Jun 2 '07 #1
3 3226
JConsulting
603 Expert 512MB
Hi!

I have a table in my Access 2003 db containing OLE Object field with Word Document. What i want to do is to open an unbound copy of Document in MSWord application so the source in the table will remain intact and changes made to the Document will not be saved in the db.
I've not succeded to open the object through ADO recordset. The only solution seems to me is to access the object through Bound Object Frame control.

So the question is how can I make an independant copy of BoundObjectFrame.Object in order to close the form with source control?

Thanks.
use a click event...if you have the name of your linked Doc..pass it to this function. When it opens, you can make changes all you want then use SaveAs option to save it

Expand|Select|Wrap|Line Numbers
  1. Function CopyDoc(strDoc As String)
  2. Dim wrd As Object
  3. Set wrd = CreateObject("Word.Application")
  4. wrd.Visible = True
  5. wrd.Documents.Open strDoc
  6. End Function
  7.  
J
Jun 2 '07 #2
FishVal
2,653 Expert 2GB
Thanks.

I've ment completely the different thing. The solution you've offered I've already used. My intension is to embed Word documents used as report templates into the db and store them in OLEObject table field.
It seems to me impossible to create a corresponding object from OLEObject field accessing table through ADO. By the way, does anybody knows how to do it ?????
The simplest solution to my mind is to create form with BoundObjectFrame control and to access the correponding document through Object property of the control. This has two disadvantages: 1) a changes made to the object will be saved in db, 2) the above mentioned form have to be open throughout the time period one works with the document. This could be overcome by different methods and tricks (e.g. opening the document, saving in temp file and reopening from the temp file etc.). This is problem that could be easily solved.

The question I've asked is more general. Does anybody know how to clone an object in VBA, this means to make a completely independant copy of the object ?????
Jun 2 '07 #3
MMcCarthy
14,534 Expert Mod 8TB
If by an object you mean a file object then this basic function should work.

Expand|Select|Wrap|Line Numbers
  1.  
  2. Function copyOverFile(fromPath As String, toPath As String)
  3. Dim fs As Object
  4.     Set fs = CreateObject("Scripting.FileSystemObject")
  5.     fs.CopyFile fromPath, toPath, True
  6.  
  7. End Function
  8.  
To use this function you have to reference the Microsoft Scripting Runtime library (Scrrun.dll)
Jun 4 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Claudiu | last post by:
Hi, I am storing word documents in embedded OLE fields (Access 2000). The ole field is bound to a "bound object frame". Whenever I create a new record the user must select "insert object"...
0
by: Lyn | last post by:
I am having a frustrating time trying to do a simple insert of a BMP picture into a Bound Object Frame using both VBA and the Insert | Object... dialog. I had a separate post thread going on this...
13
by: ahaupt | last post by:
Hi all, I'm implementing the Clone() method through the ICloneable interface and don't quite know how deep I need to go for a deep copy. Example: class A: ICloneable { object _val;
3
by: Bill | last post by:
I have a seating chart web form that has over 50 entry field controls (tables/booths) where I use a DropDownList box to select a single company name from a single large list of organizations (200...
3
by: Jul | last post by:
Hi, I need to create copy (clone) the OracleConnection object. The OracleConnection class does not contain "Clone" method for creating copy. It contains Protected MemberwiseClone but if use...
0
by: Tim Marshall | last post by:
A2003. I would desperately like to have a similar ole object on a report object such that when the report is printed, it takes all the properties of a similar object on the form. In this case,...
4
by: Rico | last post by:
Hello, I have an MDE application where I use a bound object frame to display an image. This frame is updatable and bested on the contents of an OLE field. My problem is, some images display as...
2
by: robert.waters | last post by:
I am using the GetLinkedPath() function provided by MS (http:// support.microsoft.com/kb/199066) to extract the path to embedded OLE objects, but it is only working properly for bound object frames...
1
by: Mike | last post by:
Hello everybody My applications use a Bound Object Frame on some of the forms, which display the application logo and/or the client's logo. These logo's are stored in tables as OLE Objects. ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.