Solved

Confused why write is denied

Posted on 2004-08-27
2
802 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:Tom Knowlton
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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:Tom Knowlton
ID: 11932098
Guess what it was?

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

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

624 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