Word Viewer
I was wondering if anyone knew how(if possible) I could store bits and peaces of a word document(including images, in a blob for example) in a database and then fetch it from there and view/edit in a winform, not in ms word.
Microsoft.Office.Interop.Word.dll
Use it to get the info out of the doc...
Use System.Data to store and retrieve your info
Use a RTF, Textbox, browser, or other control on a winform to display..
Without getting into the code thats as simple as it gets...
thanks for the reply DMan1
Maybe your misunderstanding a tiny little bit.
There is no word document in the beginning. I need to be able to create and edit text (and it's format) and save it in DB in some format so I can later on "paste" it in a Word document(with formatting) that I create with .Net
I have a MySQL database so I would probably store the information as binary data in a blob.
Is the textbox for example able to view word formatted text by default?
1. Create a blank document from your dot net application.
2. Launch the document so that it is visible to the user (it is in word at this point)
3. You can then catch the close/save event and then save the file to an 'image' datatype in sql server.
It is then a simple process to get the file out f the server and allow the user to edit it as they please. As long as you launch the file from your app you should be able to catch enough events to do what you need with the file.
The following are my posts asking the questions I needed to get this working:
How to open a file (and monkey arrond with it): http://www.builderau.com.au/architect/dotnet/0,39024710,39198903,00.htm
How to save it in your DB:
http://www.windowsitpro.com/Articles/Print.cfm?ArticleID=37903
And a usefull code snipet for telling when your word app is closing:
Private Sub DocIsClosing(ByVal doc As Microsoft.Office.Interop.Word.Document, ByRef b As Boolean) Handles wordApp.DocumentBeforeCloseConsole.WriteLine("Word Document closing") End Sub |
Hope this helps,
Danny
At the end I guess I will use your solution which would be great if it werent for the list.
For those interested, here's(www.highlanders.is/screen.jpg) a screenshot of what I want it to do.
I have this datagridview and I want the user to be able to either edit the text IN the datagridview (which probably is a major work, if even possible) or just click each row and edit it's text in the box below.
Hello,
I am using Visual C++.Net 2003.
I would like to run Msword 2003 as a part of the windows form.
I added a reference to Ms word 11.0 object library.
It gets updated in the solution Explorer but when
I try to code Microsoft::Office::, there is no other option except Core
i.e. Microsoft::Office::Core;
How do I resolve this?
Thank you in advance for your help.