Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

how to save MS Word document allocated in memory of web server to client machine

Posted on 2010-11-25
11
Medium Priority
?
519 Views
Last Modified: 2012-05-10
I load a MS Word file into memory server side of asp.net page, modify it there. I want to know how to save it to client machine?
0
Comment
Question by:AlexKostrub
[X]
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
  • 5
  • 4
  • 2
11 Comments
 
LVL 5

Expert Comment

by:Xper4net
ID: 34212767
You have to save it on server side, into a temporary folder, and then propose the client to download it. Once done, you can remove it from server.
0
 
LVL 19

Expert Comment

by:Bardobrave
ID: 34212810
For obvious security reasons you cannot directly save a file in a client computer through a web application. What you can do is to stream the file data to the browser, wich will open the document with it's associated application.

Then users can decide if they save it to disk or not.
0
 

Author Comment

by:AlexKostrub
ID: 34212841
To Bardobrave: I think it is possible to save file to client machine with SaveAs Dialog. How it can be implemented. And how to stream MS Word document if I have variable of type Microsoft.Office.Interop.Word.Document , let's say WordDoc, that contains all data I need to save?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 19

Expert Comment

by:Bardobrave
ID: 34213383
Well... if you execute from your server code (where your word interop object is created) a piece of code to invoke "Save As" dialog, you'll be probably opening that dialog "on the server"... but I'm not very sure...

Msdn documentation also don't throws so much light about that, but you can try it and see what happens.
http://msdn.microsoft.com/en-en/library/63w57f4b%28v=VS.80%29.aspx



0
 
LVL 5

Expert Comment

by:Xper4net
ID: 34213471
If you succeed to invoke a "save as" dialog on client side, I'll eat my hat ;-)
Seriously, you waste your time. You have to pass by a temporary file. Solution from Bardobrave can do the job too, but the use case is slightly different, and it needs Word installed on client side.
0
 

Author Comment

by:AlexKostrub
ID: 34213641
To Bardobrave: I mean activate SaveAs dialog on client machine using Response object but I still don't know how to write Microsoft.Office.Interop.Word.Document variable into it.
0
 

Author Comment

by:AlexKostrub
ID: 34213658
That is why I am looking for a way to write data stored in designated variable  to Response stream. Anyone knows how to do this?
0
 
LVL 19

Expert Comment

by:Bardobrave
ID: 34214340
Take a look at this thread.

http://forums.asp.net/t/1178233.aspx

Maybe tomorrow I have more time to explain it more deeply or put some code example.
0
 

Author Comment

by:AlexKostrub
ID: 34221226
Bardobrave, I am waiting for your explanation or/and code example
0
 
LVL 19

Accepted Solution

by:
Bardobrave earned 750 total points
ID: 34221689
Here there's a great explanation of working with word interop. What you need to do is to open the document on client machine, once done is all to the user to decide if he saves it to disk or not.

http://www.c-sharpcorner.com/UploadFile/amrish_deep/WordAutomation05102007223934PM/WordAutomation.aspx

I hope it helps.
0
 

Author Closing Comment

by:AlexKostrub
ID: 34386249
I asked slightly different thing but satisfied with an answer.
0

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

Preface: When I started this series, I used the term CommandBars because that is the Office Object class that it discusses. Unfortunately, when Microsoft introduced Office 2007, they replaced the standard Commandbar menus with "The Ribbon" and rem…
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
This video walks the viewer through the process of creating an MLA formatted document, as well as a bibliography with citations.
In a previous video Micro Tutorial here at Experts Exchange (http://www.experts-exchange.com/videos/1358/How-to-get-a-free-trial-of-Office-365-with-the-Office-2016-desktop-applications.html), I explained how to get a free, one-month trial of Office …
Suggested Courses

688 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