Method to handle Word/PPT/XLS attachment insertion in Word Auto Mo

V

Vinod

Dear All

MS-Office Attachment Types in our Word Automation Module are failing to
insert th attachment as Object to Word Creation Module throwing the below
error. Also, all Word users are affected due to word hanging ! Please can you
help me resolve this issue !

Kind regards

Vinod


Server Error in '/ProjectClosure' Application.


--------------------------------------------------------------------------------

The process cannot access the file
'D:\ProjectClosure\Docs\AdditionalInformationtest.docx' because it is being
used by another process.

Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.

Exception Details: System.IO.IOException: The process cannot access the file
'D:\ProjectClosure\Docs\AdditionalInformationtest.docx' because it is being
used by another process.

Source Error:



Line 2610: ad = new SqlDataAdapter(pSqlCommand);

Line 2611: ad.Fill(result);

Line 2612:
File.WriteAllBytes(Server.MapPath("Docs\\"+item["FileType"] +
result.Rows[0].ItemArray[0].ToString()), (byte[])result.Rows[0].ItemArray[1]);

Line 2613: attachmentsNames.Add(item["FileType"].ToString(),
Server.MapPath("Docs\\"+item["FileType"] +
result.Rows[0].ItemArray[0].ToString()));

Line 2614: }



Source File: D:\ProjectClosure\PIProposalDocWord.aspx.cs Line: 2612

Stack Trace:



[IOException: The process cannot access the file
'D:\ProjectClosure\Docs\AdditionalInformationtest.docx' because it is being
used by another process.]

System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
+2002429

System.IO.FileStream.Init(String path, FileMode mode, FileAccess access,
Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize,
FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean
bFromProxy) +998

System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access,
FileShare share) +114

System.IO.File.WriteAllBytes(String path, Byte[] bytes) +57

PIProposalDocWord.SaveAttachments(Int32 id) in
ProjectClosure\PIProposalDocWord.aspx.cs:2612

PIProposalDocWord.GenerateProposal(Int32 nPWFID) in
ProjectClosure\PIProposalDocWord.aspx.cs:2499

PIProposalDocWord.Page_Load(Object pSender, EventArgs pEventArgs) in
ProjectClosure\PIProposalDocWord.aspx.cs:106

System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o,
Object t, EventArgs e) +15

System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender,
EventArgs e) +33

System.Web.UI.Control.OnLoad(EventArgs e) +99

System.Web.UI.Control.LoadRecursive() +47

System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top