Sirdots
asked on
Saving a word document for different users
I have a windows application written with c#. I integrated Microsoft word into it so I can type, save and spell check documents. This is for every user in my database. A customer information is loaded on a form based on a phone number(id) for display and the button exists on the form.
How can I save the content of this word document to my sql server database for this particular user. This is like a note for every customer.
Thanks.
Here is the code behind the command button.
object oMissing = System.Reflection.Missing. Value;
object oEndOfDoc = "\\endofdoc"; /* \endofdoc is a predefined bookmark */
//Start Word and create a new document.
Word._Application oWord;
Word._Document oDoc;
oWord = new Word.Application();
oWord.Visible = true;
oDoc = oWord.Documents.Add(ref oMissing, ref oMissing,
ref oMissing, ref oMissing);
How can I save the content of this word document to my sql server database for this particular user. This is like a note for every customer.
Thanks.
Here is the code behind the command button.
object oMissing = System.Reflection.Missing.
object oEndOfDoc = "\\endofdoc"; /* \endofdoc is a predefined bookmark */
//Start Word and create a new document.
Word._Application oWord;
Word._Document oDoc;
oWord = new Word.Application();
oWord.Visible = true;
oDoc = oWord.Documents.Add(ref oMissing, ref oMissing,
ref oMissing, ref oMissing);
ASKER
Thanks. It doesnt help but I appreciate it. Definately, I will have a table with two columns. How do I insert the content of this word document into the tabl? where do I grab it? This is what I want to know.
Thanks.
Thanks.
Try using oDoc.Content to save on to the db
ASKER
Am I using the save as from Ms word or creating a command button to save the document.?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The Notes column should be of type binary large object, or BLOB
Insert the contents of the doc into the blob column.
Hope this helps.
cheers