Ciao,
ho un nuovo problema,sto tentando di creare un documento word da un template dot
questo è il mio codice
e questo è l'errorecodice:object oMissing = System.Reflection.Missing.Value; object oEndOfDoc = "\\endofdoc"; /* \endofdoc is a predefined bookmark */ //Start Word and create a new document. Word._Application oWord; Word._Document oDoc; oWord = new Word.Application(); String path = HttpContext.Current.Request.ApplicationPath; // object oTemplate = "~/Resources/template.dot"; object oTemplate = "C:\\Sviluppo\\BNL\\Patrimonio\\BNLGestionePatrimonio\\BNLGestionePatrimonio\\Resources\\Doc\\templateSIM.dot"; oDoc = oWord.Documents.Add(ref oTemplate, ref oMissing, ref oMissing, ref oMissing); String nomeFile = "IT-115-VAC-VerbaleAccettazione"; object oBookMark = "progetto"; // oDoc.Bookmarks.get_Item(ref oBookMark).Range.Text = "PRG"; oBookMark = "codice"; // pathDest = "C:\\inetpub\\wwwroot\\GestSIM\\Documenti\\"; oWord.ActiveDocument.SaveAs("C:\\Sviluppo\\BNL\\Patrimonio\\BNLGestionePatrimonio\\BNLGestionePatrimonio\\" + nomeFile + ".doc", ref oMissing); oWord.ActiveDocument.Close(); oWord.Quit(); System.Runtime.InteropServices.Marshal.ReleaseComObject(oWord); oWord = null;
Potete aiutarmicodice:Il filtro messaggi ha indicato che l'applicazione è impegnata. (Eccezione da HRESULT: 0x8001010A (RPC_E_SERVERCALL_RETRYLATER)) Descrizione: Eccezione non gestita durante l'esecuzione della richiesta Web corrente. Per ulteriori informazioni sull'errore e sul suo punto di origine nel codice, vedere la traccia dello stack. Dettagli eccezione: System.Runtime.InteropServices.COMException: Il filtro messaggi ha indicato che l'applicazione è impegnata. (Eccezione da HRESULT: 0x8001010A (RPC_E_SERVERCALL_RETRYLATER)) Errore nel codice sorgente: Riga 50: // pathDest = "C:\\inetpub\\wwwroot\\GestSIM\\Documenti\\"; Riga 51: Riga 52: oWord.ActiveDocument.SaveAs("C:\\Sviluppo\\BNL\\Patrimonio\\BNLGestionePatrimonio\\BNLGestionePatrimonio\\" + nomeFile + ".doc", ref oMissing); Riga 53: Riga 54: oWord.ActiveDocument.Close(); File di origine: C:\Sviluppo\BNL\Patrimonio\BNLGestionePatrimonio\BNLGestionePatrimonio\Default.aspx.cs Riga: 52 Traccia dello stack: [COMException (0x8001010a): Il filtro messaggi ha indicato che l'applicazione è impegnata. (Eccezione da HRESULT: 0x8001010A (RPC_E_SERVERCALL_RETRYLATER))] Microsoft.Office.Interop.Word._Document.SaveAs(Object& FileName, Object& FileFormat, Object& LockComments, Object& Password, Object& AddToRecentFiles, Object& WritePassword, Object& ReadOnlyRecommended, Object& EmbedTrueTypeFonts, Object& SaveNativePictureFormat, Object& SaveFormsData, Object& SaveAsAOCELetter, Object& Encoding, Object& InsertLineBreaks, Object& AllowSubstitutions, Object& LineEnding, Object& AddBiDiMarks) +0 BNLGestionePatrimonio._Default.Page_Load(Object sender, EventArgs e) in C:\Sviluppo\BNL\Patrimonio\BNLGestionePatrimonio\BNLGestionePatrimonio\Default.aspx.cs:52 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25 System.Web.UI.Control.LoadRecursive() +71 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3048
Grazie!!!!!!!!!!

Rispondi quotando