'Ecriture du fichier sur le serveur
Dim strFile As String
strFile = strFile.Format("{0}crcoo.rtf", Application("sExportFichierCRCOO" ))
Dim fs As FileStream = new FileStream(strFile, FileMode.OpenOrCreate, FileAccess.ReadWrite)
Dim w As StreamWriter = new StreamWriter(fs, System.Text.Encoding.default)
w.BaseStream.Seek(0, SeekOrigin.Begin)
w.Write(crcoo)
w.Flush()
w.Close()
'enregistrement du document en .doc
Dim oApp As New Application
Dim oMainDoc As Document
'response.write (strFile)
'response.end
oMainDoc = oApp.Documents.Open(strFile)
strFile = Replace(strFile,".rtf",".doc" )
try
oMainDoc.SaveAs(strFile)
Catch erreur As Exception
response.write(" <pre>Erreur:<br> '" & erreur.toString & "'</pre><br>" )
CType(oMainDoc, WordApp._Document).close()
CType(oApp, WordApp._Application).Quit()
response.end
End Try
l'erreur se situe au niveau du oMainDoc = oApp.Documents.Open(strFile)