Use shared access for the WORD Document so that the code will not crash,

This commit is contained in:
Rich 2016-06-14 19:50:09 +00:00
parent c67d516743
commit 7de1b026fe

View File

@ -241,7 +241,7 @@ namespace Volian.Controls.Library
try try
{ {
FileInfo fi = new FileInfo(temppath); FileInfo fi = new FileInfo(temppath);
FileStream fs = File.Open(temppath, FileMode.Open, FileAccess.Read, FileShare.None); FileStream fs = File.Open(temppath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
long len = fs.Length; long len = fs.Length;
byte[] ByteArray = new byte[len]; byte[] ByteArray = new byte[len];
int nBytesRead = fs.Read(ByteArray, 0, (int)len); int nBytesRead = fs.Read(ByteArray, 0, (int)len);