|
-
Nov 4th, 2002, 01:35 PM
#1
Thread Starter
New Member
Rendering OLE Fields programatically:
Rendering OLE Fields programatically:
I've created an MS Access database with an OLE field.
In MS Access, I populate the field by double-clicking (which opens word) and then saving the document in the database field. When I double-click the document opens again, revealing my document.
So far, so good.
Using VB, my program creates a new document which I intend to use as a report (I know how to do this).
Here's the problem:
I am reading by database using ADODB and want to know how
insert the data from the OLE field (populated with a Word Document) into my new document. The effect would be the same as copying text from one document into another document. I've done extensive work in manipulating Word documents via VB and know how to do most of what I need to do. Seems like the data in the OLE field is not stored the same way as it is when a document is save to the file system. I tried setting a range in the target document with the data from the OLE field but that did'nt work. Also note that this is a "report" and I do not want user interface other than clicking a button to run the report. That means no clicking of a control to open the document (stored in the OLE field) other than to enter the data in the fileld.
Perhaps I also could be of assistance to those who can answer this! Thanks.
-
Nov 4th, 2002, 07:16 PM
#2
PowerPoster
Hmm i dont quite get what your trying to do exactly.
If you want to store the text of the report then just use a memo field.
OLE stores it as binary so you have to "convert" it to something readable.
Such routines are in the top thread in the "Store anything in a database" bit.
good luck
b
-
Nov 5th, 2002, 10:25 AM
#3
Thread Starter
New Member
Thanks for the response.
Perhaps this is a better description of what I’m trying to achieve:
Currently:
I have a table in an MS Access database that contains an OLE field.
When I double-click the OLE field, an MS Word document appears.
I enter a small amount of bulleted text in the document.
I save the table.
I’m done.
Here’s what I want to do in a VB procedure:
Read the database (I know how to do that via ADODB)
Open a new Word document via OLE (CreateObject). I also know how to do that.
Insert database information into the document in a Word table. Again, I know how to do that; except:
When I insert the OLE field into a document range from my MS Access record, the data in the new document does not appear as “formatted text “; the binary string is is displayed.
I simply want to paste the data from my OLE field (per record) into my document (programmatically).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|