Word Viewer

Not sure if this is the right forum for this but here goes;
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.
[289 byte] By [Andri] at [2007-12-16]
# 1
Create a refernce to the Word Library:

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

DMan1 at 2007-9-9 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 2

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?

Andri at 2007-9-9 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 3
I tried the RTF but didn't see that it supports text being aligned next to pictures except one line of it. TextBox seems to have no formatting control other than the same for everything in it and the browser solution doesn't charm me, it sounds like a mixing solution and probably using to many pc resources. Are you guys honestly telling me that the great MS doesnt offer a control to view/edit data in word format and store in a DB instead of a doc file?
Andri at 2007-9-9 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 4
I have just been working on a very similar problem. Eventualy I have gone with the following:

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.DocumentBeforeClose

Console.WriteLine("Word Document closing")

End Sub



Hope this helps,

Danny

CodeScribler at 2007-9-9 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 5
Great thanks alot, this helps alot. Will probably try to use some sort of this solution. But my problem is a little bit more complex Tongue Tied.
I have a list( maybe 3-8) of short text's which I want the user to be able to either select from or edit so I kinda need something inside the windows form.

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.

Andri at 2007-9-9 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 6

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.

Minad at 2007-9-9 > top of Msdn Tech,Windows Forms,Windows Forms General...