Save doc in streem

Hellow. It’s my code

string dataDir = HttpContext.Current.Server.MapPath("ReportTemplate\\" + fileName);
Document doc = new Document(dataDir); 
Bookmark srcBookmark = doc.Range.Bookmarks["name"];
srcBookmark.Text = "sxsxsxsx";
doc.Save("c:\\Document.doc");

How can i save not in local path(“c:\Document.doc”) but in stream.

Thank you

Hello

Thanks for your request. Please try using the following snippet of code:

MemoryStream stream = new MemoryStream();
doc.Save(stream, SaveFormat.Doc);

Please let me know in case of any issues, I will be glad to help you.
Best regards,