473,597 Members | 2,726 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Exporting data to an embedded word document (OLE object)

2 New Member
Hi there,
I am brand new in access and VBA programming and I am asking for your help. One of the fields in my db is of the OLE object data-type. I' ve written a vb script that is executed on a button's click on my form for openning an embedded word document, on which I can write text. The text is saved on the field as soon as I close the word document. For the record, the code that I use is the following:

A.Class = "Word.Docum ent" ' Set class name.
A.OLETypeAllowe d = acOLEEither ' Specify type of object.
A.ACTION = acOLECreateEmbe d ' Create embedded object.
A.Verb = acOLEVerbOpen ‘ Open for editting
A.ACTION = acOLEActivate

Now I wonder whether there is the possibility to add some extra code so that, the values of the other fileds (text, number, dates etc.) of the current record can be exported to the the word document when I create/open it. These values are supposed to be entered earlier, mannually by the user. The idea is to be able to append text below these values in the word document so that I can have all the information I need in a single document.
I know it sounds a little bit difficult but...you never know! Any ideas?
By the way, I am using the 2000 version of Access, however if your advice is applicable only on a later version, I can simply upgrade my ms office version.

Thank you in advance
Mar 15 '07 #1
4 3348
nico5038
3,080 Recognized Expert Specialist
Looks to me that you should check the Mail merge possibilities.
It's in general a bad idea to store data that can be changed in a table in a separate document as you would need to maintain the consistency of the data. With a mailmerge always the most recent data will be used...

Nic;o)
Mar 17 '07 #2
Denburt
1,356 Recognized Expert Top Contributor
This would be one that I would need to play around with, however I would agree that a separate document using mail merge would probably be the best way to go I have worked with storing OLE objects in a table and it tends to make your database balloon in a major way, especially if you are planning on storing many records. MS Access has a 2 gig limit btw and you can get there real quick storing OLE Objects in each record the method described. The last time I did this was years ago but I it was around than 1000 pics or so at less than 100k each. BOOM 2 GIG crash non recoverable...

Although you are using the OLE object to type into you may not be storing the data as an OLE Object in which case you would only need to put it all together in a document when printing etc. (which may be the reason your asking). I get home in a couple of hours and will see if there are any updates in here, if you want, say so and I will try and give it a knock when I get to the house.
Mar 19 '07 #3
no8do
2 New Member
Looks to me that you should check the Mail merge possibilities.
It's in general a bad idea to store data that can be changed in a table in a separate document as you would need to maintain the consistency of the data. With a mailmerge always the most recent data will be used...

Nic;o)
Sorry for the delay...it's just that I didn't have internet access all these days. In the meantime I found the way to do what I wanted. I can also take a look at the mailmerge method though. Thank you anyway.
Mar 26 '07 #4
Denburt
1,356 Recognized Expert Top Contributor
Sounds like you may want to store your pics etc. in a folder and you can simply store the path in your DB. Then when the pic is needed you can put the text and pics together then.
Mar 26 '07 #5

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

Similar topics

0
1287
by: Fred Zuckerman | last post by:
I have a table with about 5000 records. Each record has an OLE object (named OLE1) that is an embedded Word document. I'd like some help writing a procedure to loop through all records and save each embedded Word doc to a separate word file. Then, I'll change the database to use the external files. Each record also has a field named "CaseNumber" which should be used for the filename. Thanks, Fred
4
15820
by: Otis Hunter | last post by:
I have been given an Access Database which contains a table that has an OLE object field that contains a Word document. That table contains hundreds of records. I would like to find out how I can write a VB script, to be executed either within Access or executed at the CMD prompt, which will loop through all the records and open the document object and save it to a Word document that I can access from Windows Explorer. An additional info...
0
3343
by: Otis Hunter | last post by:
I have been fighting with this for days and your expert help is needed! Below is the code I am executing which results with "Object doesn't support this property or method". The error is occuring on the "With Me.OLEObject" line. I am trying to extract a Word document(OLE object) from an Access database, for each record in the table, and save it as a Word Document. The 4th field of each record is a OLE object type. I may be getting...
8
25360
by: Jerry | last post by:
I have an off-the-shelf app that uses an Access database as its backend. One of the tables contains a field with an "OLE Object" datatype. I'm writing some reports against this database, and I believe this field contains data I need. When I view the table in datasheet view, all I can see in this field is the string "Long binary data". So, I've got the problem of needing to extract data from this field, but I don't know what format...
0
1907
by: Robin Tucker | last post by:
At the moment I have place-holders in my Word document (before you say it, yes I've posted this query in the VBA newsgroups but they are a little slow - in fact reply was non-existent!). I'm running through the document, finding the placeholders (which are jpeg images) and replacing them with OLE objects, the location of which is stored in a hyperlink on the image. The reason I'm doing this is because my reporting package flattens OLE...
3
17168
by: nigel.thomson | last post by:
Hello All Is there an easy way to do this? I have a database that contains records witha image as one of the fields, what I want to do is export the images to a seperate folder, in whatever foremat is suitable (gif, jpeg etc) But i can't work out how to do this This is all the information i have
1
12244
by: John Welch | last post by:
I'm trying to use the Mergit() function from the MS Knowledge base article to merge data from a query or table in my Access 2000 mdb into an existing word merge document. Every time it runs it brings up the dialog "Confirm Data Source", and asks if I want to use OLE, DDE, or ODBC. If I say ODBC, it then asks me for the table name. If I do all that, the merge works correctly, but I don't want users to have to do all that. I thought the...
2
2863
by: Mux | last post by:
I am facing the following problem while exporting data to Word. The current implementation is as described below: I have a JSP file which has a link that enables you to export the data to Word. Clicking on the link invokes a javascript function: function showRTF() { var newWin = window.open("", "newWin","width=900,height=800%,scrollbars=yes,menubar=yes,resizable=yes,too
0
3994
by: funeeldy | last post by:
I need to locate a particular table in a document. I cannot hardcode the table number since it could be different in every doc. I do have some header text that comes right before it consistently, though. So, I tried to find that text, and then move to the next table. Then I need to add a row to the table which already has 4 columns. I need to maintain the old content of the table too. I think I am pretty close, but having a little trouble...
0
7979
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8281
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8381
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
6706
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5847
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3893
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3937
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2409
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1245
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.