By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,009 Members | 1,487 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,009 IT Pros & Developers. It's quick & easy.

Exporting data to an embedded word document (OLE object)

P: 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
Share this Question
Share on Google+
4 Replies


nico5038
Expert 2.5K+
P: 3,072
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
Expert 100+
P: 1,356
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

P: 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
Expert 100+
P: 1,356
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

Post your reply

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