Tom Knowlton
asked on
Confused why write is denied
PROBLEM: Error Message: System.Runtime.InteropServ ices.COMEx ception (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.BFFaxC OM.Generat eRequest()
========================== ========== ==
Here is the code for BFFaxCOM.GenerateRequest( )
public bool GenerateRequest()
{
try
{
//genFuncs.SendMessage("be nb@buyersf und.com"," GenerateRe quest was called","GenerateRequest was called");
//genFuncs.SendMessage("to m@buyersfu nd.com","G enerateReq uest was called","GenerateRequest was called");
bool doc_exists_already = false;
string strSQL="";
bool documentGenerationFinished = false;
FillDocValues(this.DocRequ estIDFromD ocumentReq uestTable) ;
string tempFileName = "";
FAXCOM_DATASET = genFuncs.GenerateDataSet(F AXCOM_SQL_ STATEMENT, this.strPi pelineDBCo nnection);
lock(this)
{
documentGenerationFinished = CreateDocument();
}
if(documentGenerationFinis hed)
{
tempFileName = DocRequestUseThisFileNameF orDocument ;
doc_exists_already = File.Exists(tempFileName);
object fileName = tempFileName;
object SaveChanges = true;
oWord.ActiveDocument.SaveA s(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 = GetDocReqIDGivenUniqueFile Name(tempF ileName);
if(doc_exists_already==fal se)
{
strSQL = "insert into documentTracking (DocumentRequestID, DateRecorded, MessageReturned) values(" + iRequestID + ", '" + dt + "', 'Document has been created')";
SqlConnection connection = new SqlConnection(strDBConnect ion);
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","PRO BLEM FOUND IN FAXCOM","PROBLEM: Error Message: " + eee.ToString());
return false;
}
}
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(
at BuyersFund.BFFaxCOM.BFFaxC
==========================
Here is the code for BFFaxCOM.GenerateRequest( )
public bool GenerateRequest()
{
try
{
//genFuncs.SendMessage("be
//genFuncs.SendMessage("to
bool doc_exists_already = false;
string strSQL="";
bool documentGenerationFinished
FillDocValues(this.DocRequ
string tempFileName = "";
FAXCOM_DATASET = genFuncs.GenerateDataSet(F
lock(this)
{
documentGenerationFinished
}
if(documentGenerationFinis
{
tempFileName = DocRequestUseThisFileNameF
doc_exists_already = File.Exists(tempFileName);
object fileName = tempFileName;
object SaveChanges = true;
oWord.ActiveDocument.SaveA
oWord.ActiveDocument.Close
DateTime dt = new DateTime();
dt = DateTime.Now;
long iRequestID = GetDocReqIDGivenUniqueFile
if(doc_exists_already==fal
{
strSQL = "insert into documentTracking (DocumentRequestID, DateRecorded, MessageReturned) values(" + iRequestID + ", '" + dt + "', 'Document has been created')";
SqlConnection connection = new SqlConnection(strDBConnect
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@
return false;
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Needed to use a UNC path vs a mapped drive to the share.