Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET2.0
Hi Guys,
 
Can anyone please help me in get rid of this error. I have an application which will generate offer letter in word format. When there are many winword process opened in the server i am getting error message "the message filter indicated that the application is busy rpc_e_servercall_retrylater".
 
Is there any way to prevent this error message occuring.
 
I am using c# language to develop the code.
 

Here is my code for opening & closing word document.
 
public WordTemplate()
{
objWApp = new Word.ApplicationClass();
}
 
public void OpenWord()
{
try
{
object objMissingValue = System.Reflection.Missing.Value;
objDoc = objWApp.Documents.Add(ref objMissingValue, ref objMissingValue, ref objMissingValue, ref objMissingValue);
objDoc.Activate();
}
catch (Exception ex)
{
throw ex;
}
}
 
public void OpenWord(string strFileName)
{
try
{
object objMissingValue = System.Reflection.Missing.Value;
object objFileName = strFileName;
object objIsReadOnly = false;
object objIsVisible = true;
objDoc = objWApp.Documents.Open(ref objFileName, ref objMissingValue, ref objIsReadOnly, ref objMissingValue, ref objMissingValue, ref objMissingValue, ref objMissingValue, ref objMissingValue, ref objMissingValue, ref objMissingValue, ref objMissingValue, ref objIsVisible, ref objMissingValue, ref objMissingValue, ref objMissingValue, ref objMissingValue);
//objDoc = objWApp.Documents.Open(ref objFileName, ref objMissingValue, ref objMissingValue, ref objMissingValue, ref objMissingValue, ref objMissingValue, ref objMissingValue, ref objMissingValue, ref objMissingValue, ref objMissingValue, ref objMissingValue, ref objMissingValue, ref objMissingValue, ref objMissingValue, ref objMissingValue, ref objMissingValue);
objDoc.Activate();
}
catch (Exception ex)
{
throw ex;
}
}
public void Close()
{
try
{
object objMissingValue = System.Reflection.Missing.Value;
objWApp.Quit(ref objMissingValue, ref objMissingValue, ref objMissingValue);

}
catch (Exception ex)
{
throw ex;
}
finally
{
objDoc = null;
objWApp = null;
GC.Collect();
GC.WaitForPendingFinalizers();
}
}
 

Thanks,
Prashant
Posted 21-Feb-13 16:04pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 668
1 OriginalGriff 396
2 Tadit Dash 345
3 sanket saxena 329
4 Peter Leow 203
0 Sergey Alexandrovich Kryukov 12,109
1 OriginalGriff 7,326
2 Peter Leow 5,013
3 Abhinav S 4,013
4 Maciej Los 3,575


Advertise | Privacy | Mobile
Web02 | 2.8.140421.2 | Last Updated 21 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid