Frm_Main.cs
View Code
1 using System;
2 using System.Collections.Generic;
3 using System.ComponentModel;
4 using System.Data;
5 using System.Drawing;
6 using System.Linq;
7 using System.Text;
8 using System.Windows.Forms;
9 using Microsoft.Office.Core;
10
11 namespace WordInForm
12 {
13 public partial class Frm_Main : Form
14 {
15 public Frm_Main()
16 {
17 InitializeComponent();
18 }
19
20 private void btn_Get_Click(object sender, EventArgs e)
21 {
22
23 }
24
25 private void 打开ToolStripMenuItem_Click(object sender, EventArgs e)
26 {
27 OpenFileDialog P_GetFile = new OpenFileDialog();//创建打开文件对话框对象
28 DialogResult P_dr = P_GetFile.ShowDialog();//显示打开文件对话框
29 if (P_dr == DialogResult.OK)//是否点击确定
30 {
31 WebBrowser.Navigate(P_GetFile.FileName);//打开Word文档并显示
32 }
33 }
34
35 private void 退出ToolStripMenuItem_Click(object sender, EventArgs e)
36 {