Solved

Confused why write is denied

Posted on 2004-08-27
2
800 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How can I do Unit Testing with Session ? 1 41
I need help adding validation to my MVC.Net view 6 36
orderby list (from Json) 1 44
Visual Studio 2015 auto inserted code 12 88
Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

739 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