importing a newly created Word obj into SQLServer
Hello All,
I am trying to create a Word document on the fly in VS.NET and then import it into a SQLServer 2000 database. I want to do it without having to save the doc object as a file on a server. I've tried using the Stream object, FileStream object, MemoryStream object... I can't figure out how to make any of it work. I'm assuming I need to save it as an image field in the database, but I can't make it happen. Here's how I've started:
Dim oWord As Word.Application
Dim oDoc As Word.Document
Dim oPara As Word.Paragraph
oWord = CreateObject("Word.Application")
oWord.Visible = True
oDoc = oWord.Documents.Add
oPara = oDoc.Content.Paragraphs.Add()
...
[code to build out document]
...
I know that I have succesfully created a doc because I can save it to a directory on the server, but I don't want to store this on the server. What can I do next to successfully get this document object into SQLServer 2000 without first saving it to the server?
Thanks,
Scott
|