Beispiel #1
0
        protected override void OnShown(EventArgs e)
        {
            base.OnShown(e);
            WinWordDocForm frm = new WinWordDocForm();

            frm.Text = "temp.doc";
            frm.OpenDocument(string.Format("{0}/{1}", Application.StartupPath, "temp.doc"));
            frm.Show(this.dockPanel1);
            frm.Activate();
        }
Beispiel #2
0
        private void WordSelect_Click(object sender, EventArgs e)
        {
            OpenFileDialog fileDialog = new OpenFileDialog();

            if (fileDialog.ShowDialog() == DialogResult.OK)
            {
                if (fileDialog.FileName.Contains("doc"))
                {
                    WinWordDocForm frm = new WinWordDocForm();
                    frm.Text = System.IO.Path.GetFileName(fileDialog.FileName);
                    frm.OpenDocument(fileDialog.FileName);
                    frm.Show(this.dockPanel1);
                    frm.Activate();
                }
            }
        }