Accessing client PC word document

Hi,

I've a template document residing on my web server. Currently, what I'm doing is copying the template file in the server to another file in the server. Afterwhich my VB.NET program will modify the contents of the copied file based on the input by user. This works fine as all the files are located in the webserver and my VB.NET program is able to access them quite easily.

However, my hosting server does not permit me to write any file in the server. Is there anyway for me to copy the template file in the server to another file on the client PC and then modifying the contents of the client PC document based on the user's input. Afterwhich I want to display the modified document.

In short is there methods in ASPOSE.WORD to enable me to read and write local PC word document and displaying them.

thanks

Desmond

Thank you for a detailed task description.

Answering your question:

  1. Aspose.Words library allow you to open, manipulate and save word document files. It can also open and save documents from/to memory streams avoiding the necessity for writing files on the disk.
  2. The displaying of word files is done by Aspose.Words.Viewer which is a part of Aspose.Words library. It is however in a beta stage now. Its release is planned on April 2006.
  3. Aspose.Words working as part of server application does not have the ability to access the files on the client side by itself. It is up to ASP.NET application to manage file transfers from server to client and back.

Hi,

thanks for your reply

Is it possible for me to save a template file in memory streams...modify the contents in memory streams and then displaying it to the user ?

Reason : My hosting server does not allow me to have Write rights to any of the folders in the server. My present solution copies a template file to temp file, modify temp file and then display the temp file for the user. If my hosting server does not permit me even to create a temp file I need to resort to writing in streams and then displaying it.Possible ?

thank you and any help will be greatly appreciated.

Desmond

You see, Aspose.Words does not manipulate document files (or document streams) directly but loads the document from file or memory stream into an object model. All manipualtion is done in object model in memory. Then you can save the results to a file or send them in http response to client. So, I think our library is perfectly suited to your task. And it does not require MS Word for its work at all. It does the job completely on its own.

Hi,

This is great !

I now need not copy the template file to another file and make modifications to the copied file.

I also checked up "Sending to a Client Browser" section in the programmer's reference in your web site and those codes there are really very helpful. These codes enable me to send the modified word document to the Client Browser and choose Word Document to open it up. This is just fantastic !

Hope you can help me on this one. When I send the documen to the client browser there is always a dialog box asking the user to 'Open', 'Save' or 'Cancel'... and when the user chooses 'Open' the MS Word will indicate that the filename - as speciifed in filename parameter of doc.save method - could not be found. Any idea why this is so ?

Not really a big issue though, as we can always tell the user to save first and open the saved document. But if you have any solution to this, I will be very grateful.

thank you once again for all the help rendered.

Desmond

That should not occur normlly. Please tell me what syntax are you using in Document.Save. It should look like this:

doc.Save("test.doc", SaveFormat.FormatDocument, SaveType.OpenInBrowser, this.Response);

Hi,

Here's the syntax :

Dim filename As String = newCOCSno & ".doc"

doc.Save(filename, SaveFormat.FormatDocument, SaveType.OpenInWord, Response)

(newCOCSno is some value)

thanks

desmond

It should work. Please check what the 'newCOCSno' value actually is.