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 17: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 380
1 OriginalGriff 230
2 DamithSL 220
3 Zoltán Zörgő 150
4 Maciej Los 135
0 OriginalGriff 7,740
1 DamithSL 5,694
2 Sergey Alexandrovich Kryukov 5,404
3 Maciej Los 5,061
4 Kornfeld Eliyahu Peter 4,539


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

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100