Aspose.Plugins.AsposeVSOpenXML.Program.OpenAndAddToWordprocessingStream C# (CSharp) Метод

OpenAndAddToWordprocessingStream() приватный статический Метод

private static OpenAndAddToWordprocessingStream ( Stream stream, string txt ) : void
stream Stream
txt string
Результат void
        private static void OpenAndAddToWordprocessingStream(Stream stream, string txt)
        {
            WordprocessingDocument wordprocessingDocument =
                WordprocessingDocument.Open(stream, true);
            Body body = wordprocessingDocument.MainDocumentPart.Document.Body;
            Paragraph para = body.AppendChild(new Paragraph());
            Run run = para.AppendChild(new Run());
            run.AppendChild(new Text(txt));
            wordprocessingDocument.Close();
        }
    }