We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Save To Stream

Thread ID:

Created:

Updated:

Platform:

Replies:

56605 Feb 16,2007 11:10 PM UTC Feb 17,2007 10:23 AM UTC ASP.NET Web Forms (Classic) 1
loading
Tags: DocIO
Jay Slusher
Asked On February 16, 2007 11:10 PM UTC

My application needs to save documents created by DocIO using a UNC path. Since the standard IWordDocument.Save Method (String, FormatType)does not support UNC paths, I would like to use the IWordDocument.Save Method (Stream, FormatType) method since the stream does support the UNC path.

In reading the help, it refers to a "Save To Stream" sample but I can't find it in any of my samples with 4.4.0.51 or on your web site. Would you please send me the sample or provide a code snippet demonstrating how to use the Save method with a stream method.

Thanks.

Melba Winshia [Syncfusion]
Replied On February 17, 2007 10:23 AM UTC

Hi Jay,

You can use the following code snippets to save the document to a Memory Stream.

[c#]

//Create MemoryStream for storing the document.
MemoryStream memStream = new MemoryStream();
//Save document to stream.
document.Save ( memStream , FormatType.Doc );
memStream.Seek ( 0 , SeekOrigin.Begin );

//Create a FileStream
FileStream fs = new FileStream("Sample.doc",FileMode.Create);
memStream.WriteTo(fs);

//Close streams.
memStream.Close();
fs.Close();

Here is the sample for your reference:

Stream.zip

Kindly take a look at the sample above and let me know if you have any other questions.

Thanks,
Melba

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;