Home All Groups Group Topic Archive Search About
Author
2 Mar 2007 8:07 PM
HockeyFan
I have an IO.Stream that I get from an embedded resource file.  I
called GetManifestResourceStream.
This stream is that of a Word template doc.  I'd like to write this to
disk.
If my embedded resource stream is called 'wordstream', how do I take
this and write it to disk so that it can be used as a Word template?

Author
2 Mar 2007 8:20 PM
Jon Skeet [C# MVP]
HockeyFan <les.stock***@gmail.com> wrote:
> I have an IO.Stream that I get from an embedded resource file.  I
> called GetManifestResourceStream.
> This stream is that of a Word template doc.  I'd like to write this to
> disk.
> If my embedded resource stream is called 'wordstream', how do I take
> this and write it to disk so that it can be used as a Word template?

Open a FileStream to write to, and then repeatedly read from wordstream
(into a byte array) and write to the file stream until Read returns 0.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet   Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too

AddThis Social Bookmark Button