public void OpenFromStream()
{
//ExStart
//ExFor:Document.#ctor(Stream)
//ExId:OpenFromStream
//ExSummary:Opens a document from a stream.
// Open the stream. Read only access is enough for Aspose.Words to load a document.
Stream stream = File.OpenRead(MyDir + "Document.doc");
// Load the entire document into memory.
Document doc = new Document(stream);
// You can close the stream now, it is no longer needed because the document is in memory.
stream.Close();
// ... do something with the document
//ExEnd
Assert.AreEqual("Hello World!\x000c", doc.GetText());
}