void timer1_Tick(object sender, EventArgs e) { Thread th = new Thread(new ThreadStart(this.ExecWaitForm)); th.Start(); string phath = System.Environment.CurrentDirectory; // var word = new CtrlWinWord() //{ word.Dock = System.Windows.Forms.DockStyle.Fill; word.Location = new System.Drawing.Point(0, 0); word.Name = "文档"; word.TabIndex = 1; // }; //加载word的完整路径 修改此处 if (File.Exists(_url)) { word.LoadDocument(_url); word.Show(); plMain.Controls.Add(word); } timer.Enabled = false; WaitFormService.Close(); }
private void Initial() { word.Dock = System.Windows.Forms.DockStyle.Fill; word.Location = new System.Drawing.Point(0, 0); word.Name = "文档"; word.TabIndex = 1; //加载word的完整路径 修改此处 word.LoadDocument(_path + @"\1.docx"); word.Show(); panelEx1.Controls.Add(word); }
private void FrmRecord_Load(object sender, EventArgs e) { //先下载word string path = System.Environment.CurrentDirectory; string url = Helper.DownloadFile(_directory, path); Helper.KillProcess(); var word = new CtrlWinWord() { Dock = System.Windows.Forms.DockStyle.Fill, Location = new System.Drawing.Point(0, 0), Name = "文档", TabIndex = 1 }; //加载word的完整路径 修改此处 word.LoadDocument(url); //word.LoadDocument(phath + @"\1.docx"); word.Show(); panelEx3.Controls.Add(word); }