Sfilename is a path.ex:-d://test.docx.iam opening this file and do some work..at the same time wehen other person try to acess teh same file errors comes..can any one tell the solution
using
(WordprocessingDocument
_activeWordDocument = WordprocessingDocument.Open(sFileName,
true
nikitha
Member
8 Points
79 Posts
open file many users
Jun 25, 2012 06:18 AM|LINK
Hi,
Sfilename is a path.ex:-d://test.docx.iam opening this file and do some work..at the same time wehen other person try to acess teh same file errors comes..can any one tell the solution
using (WordprocessingDocument _activeWordDocument = WordprocessingDocument.Open(sFileName, true
))
{
some code...
}
urenjoy
Star
13501 Points
2035 Posts
Re: open file many users
Jun 25, 2012 08:06 AM|LINK
Multiple Write process on same file are not going to work. But you can open it in readonly mode as MS Word does.
using (WordprocessingDocument _activeWordDocument = WordprocessingDocument.Open(sFileName, false
))
{
some code...
}
nikitha
Member
8 Points
79 Posts
Re: open file many users
Jun 27, 2012 06:46 AM|LINK
HI,
I cannot use tat code because it throws error
Cannot get stream with FileMode.Create, FileMode.CreateNew, FileMode.Truncate, FileMode.Append when access is FileAccess.Read.