473,394 Members | 2,063 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,394 software developers and data experts.

Exporting data to an embedded word document (OLE object)

2
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.Document" ' Set class name.
A.OLETypeAllowed = acOLEEither ' Specify type of object.
A.ACTION = acOLECreateEmbed ' 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 3331
nico5038
3,080 Expert 2GB
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 Expert 1GB
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
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 Expert 1GB
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
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...
4
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...
0
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...
8
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...
0
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...
3
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...
1
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...
2
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....
0
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,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.