Saving a word document for different users

Posted on 2005-03-14
Medium Priority
Last Modified: 2010-04-16
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.


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);
Question by:Sirdots
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2

Expert Comment

ID: 13543025
Create a table which has two columns viz username and Notes
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.


Author Comment

ID: 13544240
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.


Expert Comment

ID: 13544507
Try using oDoc.Content to save on to the db

Author Comment

ID: 13544819
Am I using the save as from Ms word or creating a command button to save the document.?

Accepted Solution

rajaloysious earned 1000 total points
ID: 13545926
To begin with, you can do that in the command button.
In the command button click, use oDoc.Content for the blob column.. that is it..
Hope this is of help...


Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question