View Full Version : Using Word.docs stored in Access (inserting into bookmarks), perhaps OLE?


Mike375
06-20-2008, 02:10 PM
Currently I have a lot of letters that are opened from Access, data put into bookmarks, printed and the letter copied back to a memo field in a Many table. Naturally this all depends on the Word.docs being in a folder.

Is there any way that the Word docs could be stored in Access, such as an OLE field and the same thing be done.

In other words could my data base do what it does without depending on the word.docs being stored in a folder.

Edited to add


Dim WordObj As Word.Application
Dim WordDoc As Word.Document
Dim WordRange As Word.Range
Set WordObj = CreateObject("Word.Application")
Set WordDoc = WordObj.Documents.Open _
("C:\Letters\0AMPMike.doc")
WordObj.Visible = True

Is there some way I can replace this part

("C:\Letters\0AMPMike.doc")
WordObj.Visible = True

if the letter is embedded in OLE (or whatever) and then the rest of the code follows.

ajetrumpet
06-21-2008, 09:18 AM
Mike,

I have no idea, but just out of curiosity, why do you want to do this? I wrote a function not too long ago where I had a new version of Excel open so I could loop through 50 different files, but as the code was running, the application was not visible. All you saw was data populating in the spreadsheet on the screen.

Is that kinda the same thing that you're doing here?

Mike375
06-21-2008, 05:36 PM
Adam


What I would like to be able to do is to have the word.docs stored in something like OLE fields (embedded, not linked)

Currenty all the word.docs are in a folder called at c:\Letters. At different times some people will put the data base on another computer but they don't put the folder \letters and word docs on the computer and of course nothing then works.

Sticking the word.docs into OLE is simple but I have no idea how to open them and then have the data from Access go into the book marks.

I other words I would like to have the data base as a completely self contained unit