这项工作很好:
MemoryStream ms = //do some in memory on WordprocessingDocument ;
AlternativeFormatImportPart chunk = mainPart.AddAlternativeFormatImportPart(
AlternativeFormatImportPartType.WordprocessingML,
altChunkId);
using(var fs = new FileStream(@"c:\\temp\\1.docx", FileMode.Create, FileAccess.ReadWrite,FileShare.Read))
ms.WriteTo(fs);
using(FileStream fs = new FileStream(@"c:\\temp\\1.docx", FileMode.Open, FileAccess.Read))
chunk.FeedData(fs);
无法正确读取内存流WordprocessingDocument并使用OpenXml保存到另一个AddAlternativeFormatImportPart而不保存到光盘
MemoryStream ms = //do some in memory on WordprocessingDocument ;
chunk.FeedData(fs);
怎么做?
这对我很有帮助
MemoryStream ms = //do some in memory on WordprocessingDocument ;
ms.Seek(0, SeekOrigin.Begin);
chunk.FeedData(ms);