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.
Unfortunately, activation email could not send to your email. Please try again.

Save To Stream

Thread ID:

Created:

Updated:

Platform:

Replies:

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

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 05:23 AM

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.

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.

;