private void SelectFile_Click(object sender, EventArgs e) { if (ExcelOption.Checked || WordOption.Checked) { if (SelectPdf.ShowDialog() == System.Windows.Forms.DialogResult.OK) { //Chemins des fichiers string path = System.IO.Path.GetDirectoryName(SelectPdf.FileName); string pdfFile = SelectPdf.FileName; string nameFile = System.IO.Path.GetFileNameWithoutExtension(SelectPdf.FileName); string wordFile = path + @"\" + nameFile + @".docx"; string excelFile = path + @"\" + nameFile + @".xlsx"; // Conversion au format Excel if (ExcelOption.Checked) { InitializeMyTimerExcel(); Word word = new Word(); Timer_Tick_Excel(null, null); word.OuvrirPdf(pdfFile); Timer_Tick_Excel(null, null); word.CopierLesDonnees(); Timer_Tick_Excel(null, null); Excel excel = new Excel(); Timer_Tick_Excel(null, null); excel.CollerLesDonnees(); Timer_Tick_Excel(null, null); //excel.EnregistrerClasseur(excelFile); //Timer_Tick_Excel(null, null); //word.FermerTousLesProcessus(); //Timer_Tick_Excel(null, null); //excel.FermerTousLesProcessus(); //Timer_Tick_Excel(null, null); word.FermerDocumentEtApplication(); Timer_Tick_Excel(null, null); excel.AfficherClasseur(); //excel.OuvrirClasseurEnregistre(excelFile); } //Converison au format Word else if (WordOption.Checked) { InitializeMyTimerWord(); Word word = new Word(); Timer_Tick_Word(null, null); word.OuvrirPdf(pdfFile); Timer_Tick_Word(null, null); //word.EnregistrerPdfAuFormatWord(wordFile); //Timer_Tick_Word(null, null); word.AfficherDocument(); } this.Close(); } else { MessageBox.Show("Aucun fichier sélectionné.", "ATTENTION !", MessageBoxButtons.OK); } } else { MessageBox.Show("Selectionnez un format de conversion.", "ATTENTION !", MessageBoxButtons.OK); } }