Solved

Confused why write is denied

Posted on 2004-08-27
2
790 Views
Last Modified: 2008-01-09
PROBLEM:  Error Message:  System.Runtime.InteropServices.COMException (0x800A1424): Word cannot save or create this file. The disk may be full or write-protected.
Try one or more of the following:
* Free more memory.
* Make sure that the disk you want to save the file on is not full, write-protected, or damaged.
 (W:\040827133831895.do
   at Word.DocumentClass.SaveAs(Object& FileName, Object& FileFormat, Object& LockComments, Object& Password, Object& AddToRecentFiles, Object& WritePassword, Object& ReadOnlyRecommended, Object& EmbedTrueTypeFonts, Object& SaveNativePictureFormat, Object& SaveFormsData, Object& SaveAsAOCELetter)
   at BuyersFund.BFFaxCOM.BFFaxCOM.GenerateRequest()


======================================

Here is the code for BFFaxCOM.GenerateRequest(  )



public bool GenerateRequest()
            {
                  try
                  {
                  
                        //genFuncs.SendMessage("benb@buyersfund.com","GenerateRequest was called","GenerateRequest was called");
                        //genFuncs.SendMessage("tom@buyersfund.com","GenerateRequest was called","GenerateRequest was called");
                        bool doc_exists_already = false;
                        string strSQL="";
                        bool documentGenerationFinished = false;
                        FillDocValues(this.DocRequestIDFromDocumentRequestTable);
                        string tempFileName = "";
                        FAXCOM_DATASET = genFuncs.GenerateDataSet(FAXCOM_SQL_STATEMENT,this.strPipelineDBConnection);
                        
                        lock(this)
                        {
                              documentGenerationFinished = CreateDocument();
                        }

                        if(documentGenerationFinished)
                        {
                              tempFileName = DocRequestUseThisFileNameForDocument;
                              doc_exists_already = File.Exists(tempFileName);
                              object fileName = tempFileName;
                              object SaveChanges = true;
                              oWord.ActiveDocument.SaveAs(ref fileName,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing);            
                              oWord.ActiveDocument.Close(ref SaveChanges, ref oMissing, ref oMissing);

                              DateTime dt = new DateTime();
                              dt = DateTime.Now;
                              long iRequestID = GetDocReqIDGivenUniqueFileName(tempFileName);
                              if(doc_exists_already==false)
                              {
                                    strSQL = "insert into documentTracking (DocumentRequestID, DateRecorded, MessageReturned) values(" + iRequestID + ", '" + dt + "', 'Document has been created')";
                                    SqlConnection connection = new SqlConnection(strDBConnection);
                                    SqlCommand command = new SqlCommand(strSQL, connection);
                                    connection.Open();
                                    lock(this)
                                    {
                                          int numrows = command.ExecuteNonQuery();
                                    }
                              }
                              
                        }
//                        throw new Exception("ERROR HANDLING TESTING");
                        return documentGenerationFinished;
                  }
                  catch(Exception eee)
                  {
                        genFuncs.SendMessage("tom@buyersfund.com","PROBLEM FOUND IN FAXCOM","PROBLEM:  Error Message:  " + eee.ToString());
                        return false;
                  }
            }



0
Comment
Question by:knowlton
2 Comments
 
LVL 10

Accepted Solution

by:
123654789987 earned 500 total points
ID: 11928764
It must be because u are trying to save the word document into a folder where u do not have sufficient permissions.
There is a work around is suggested for this problem

http://www.kbalertz.com/kb_230155.aspx


0
 
LVL 5

Author Comment

by:knowlton
ID: 11932098
Guess what it was?

Needed to use a UNC path vs a mapped drive to the share.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
About delegates in c sharp 3 47
C# 2015 Downloading text file and preserving the line breaks 5 37
Media.Imaging 1 18
Video Player 2017 5 24
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question