Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Saving a word document for different users

Posted on 2005-03-14
5
Medium Priority
?
234 Views
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.

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);
0
Comment
Question by:Sirdots
  • 3
  • 2
5 Comments
 
LVL 8

Expert Comment

by:rajaloysious
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.

cheers
0
 

Author Comment

by:Sirdots
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.

Thanks.
0
 
LVL 8

Expert Comment

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

Author Comment

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

Accepted Solution

by:
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...

Cheers
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

581 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