📄 form1.cs
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.Office.Interop.Word;
using Microsoft.Office.Core;
namespace wordtest
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
ApplicationClass MyWord;
_Document MyDoc;
Selection MySelection;
Object[,] MyData = new Object[5000, 300];
object MyObj;
object start = 0;
object end = 0;
try
{
MyWord = new ApplicationClass();
MyObj = System.Reflection.Missing.Value;
MyWord.Visible = true;
MyDoc = MyWord.Documents.Add(ref MyObj, ref MyObj, ref MyObj, ref MyObj);
MyDoc.Select();
MyWord.ActiveWindow.Selection.InsertAfter("I get it!");
MySelection = MyWord.Selection;
}
catch (Exception MyEx)
{
MessageBox.Show("");
}
}
private void button2_Click(object sender, EventArgs e)
{
}
private void mmltableBindingNavigatorSaveItem_Click(object sender, EventArgs e)
{
this.Validate();
this.mmltableBindingSource.EndEdit();
this.mmltableTableAdapter.Update(this.cc08mmlDataSet.mmltable);
}
private void Form1_Load(object sender, EventArgs e)
{
// TODO: 这行代码将数据加载到表“cc08mmlDataSet.mmltable”中。您可以根据需要移动或移除它。
this.mmltableTableAdapter.Fill(this.cc08mmlDataSet.mmltable);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -