Mehmet Fatih

Mehmet Fatih

  • 855
  • 931
  • 39.8k

Error in sending message after saving document

Jul 8 2023 3:28 PM

I am trying to send a message after saving the document, but since the message box is activated immediately, filling document is giving an error. After completing the Word document filling process, how can we give a message?

oWord.ActiveDocument.SaveAs2(@"C:\Users\Fatih\Desktop\\Sözlesme Metni.docx");
                            MessageBox.Show("Belge 'Sozlesmemetni' adiyla masaüstüne kaydedildi.");
                            System.Runtime.InteropServices.Marshal.ReleaseComObject(oWordDoc);
                            System.Runtime.InteropServices.Marshal.ReleaseComObject(oWord);                       
                            oWordDoc = null;
                            oWord = null;

 

Answers (2)