|
Question : embed blank word doc in access file
|
|
Here's what I need to do...my customers will be entering various blobs of text to be used for document automation. They want nice formatting like you get in MS Word. No problem, I say. (am I stupid or what???)
Here's where I'm at...I can embed a blank document from a file so that when they double-click on the unbound OLE control it starts Word instead of making them go through the "insert object" dialog boxes. Good so far...
But...I'd like to embed the document from something with Access instead of having to rely on an external file
and...I'd like the Word doc that shows up to take up the entire space in the control (right now, the control takes up most of the page, but the embedded Word document takes up about 3 lines).
Here's the code I'm using to get the blank document into the form. OLEBound25 is linked to a table field (OLE object type) which is saving and retrieving just like it should:
Private Sub Form_Load()
If IsNull(OLEBound25) Then OLEBound25.Class = "Word.Application" OLEBound25.OLETypeAllowed = acOLEEmbedded OLEBound25.SourceDoc = "c:\blank.doc" OLEBound25.Action = acOLECreateEmbed End If
End Sub
Any help is much appreciated.
Wendy
|
|
Answer : embed blank word doc in access file
|
|
Doing it with linked files is definitely better than imbedded, for purposes of storage. The thing is that the data on the docs will not be in your datafile. The ActiveX control will store the data in a field of your table, and provides better formatting control you users are asking for. Also with linked documents, in conjunction with using ONE common location for them, you only have to store the specific doc name in you table in order to retreive that piece you need. The path to the documents folder can be a variable set at runtime, or stored in and retrieved from a small 'settings' table.
Using the activeX will allow you to pull the string from data and send them to a word document as formatted by the user.
It sounds like you are going to need to firmly establish some document structure guidelines as you proceed. The documents must follow a 'pattern' so that you know exactly how to approach inserting text into them.
|
|
|
|