Mehmet Fatih

Mehmet Fatih

  • 855
  • 931
  • 39.8k

Opening the word documen on front of the main form

Jul 6 2023 10:42 AM

How can we open the word documen on front of the main form? 

    Object oMissing = System.Reflection.Missing.Value;
            Object oTrue = true;
            Object oFalse = false;
            Word.Application oWord = new Word.Application();
            Word.Document oWordDoc = new Word.Document();
            oWord.Visible = true;

            Object oTemplatePath = System.Windows.Forms.Application.StartupPath + "\\Sozlesme.docx";
            oWordDoc = oWord.Documents.Add(ref oTemplatePath, ref oMissing, ref oMissing, ref oMissing);

 

Answers (5)