-2

I have a word file as an embedded resource for a c# project. I would like to read from this in during the execution of the code. Is there a way i can write this doc file to a temp location in order to produce a physical file that i can then edit and resave as another file at a location chosen by the user?

John Baum
  • 3,183
  • 11
  • 42
  • 90
  • 1
    possible duplicate of [Embedding a word file as a resource](http://stackoverflow.com/questions/9726968/embedding-a-word-file-as-a-resource) - looks like you've asked exactly the same thing yesterday... and I tried to give you all information there. – Alexei Levenkov Mar 16 '12 at 19:59
  • Check out the `System.IO` namespace. Specifically the `Path` class and the `FileStream` class. – Sam Axe Mar 16 '12 at 19:47

1 Answers1

0

I think, this is what you are looking for:

Assembly assembly = Assembly.GetExecutingAssembly();
Stream stream = assembly.GetManifestResourceStream(wordResourcePath);
Pashec
  • 23,199
  • 3
  • 26
  • 26
  • The problem im having now is that once i have written the contentes to a temp file, i cannot open the document as a openxml doc – John Baum Mar 16 '12 at 20:31