Microsoft.Office.Interop.Word.Application WordApp = new Microsoft.Office.Interop.Word.ApplicationClass();
Microsoft.Office.Interop.Word.Document WordDoc = WordApp.Documents.Add(ref Nothing, ref Nothing, ref Nothing, ref Nothing);
index = 1;
//Microsoft.Office.Interop.Word.Paragraph oPara1 = WordDoc.Content.Paragraphs.Add(ref Nothing);
//oPara1.Range.Font.Name = "Verdana";
//oPara1.Range.Font.Size = 20;
//oPara1.Range.Text = dt_试卷信息.Rows[0]["S_试卷标题"].ToString();
//oPara1.Range.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter;
//oPara1.Range.InsertParagraphAfter();//
WordDoc.Paragraphs.Last.Range.Text = dt_试卷信息.Rows[0]["S_试卷标题"].ToString() + "\n\r";
Add_选择题(WordDoc);
Add_填空题(WordDoc);
Add_判断题(WordDoc);
Add_名词解释题(WordDoc);
Add_简答题(WordDoc);
WordDoc.SaveAs(ref filename, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing);
WordDoc.Close(ref Nothing, ref Nothing, ref Nothing);
WordApp.Quit(ref Nothing, ref Nothing, ref Nothing);
MessageBox.Show("试卷生成完毕");
}}
private void button1_Click(object sender, EventArgs e)
{
this.Close();
}
S_试题筛选 s_试题筛选;
private void S_筛选_Load(object sender, EventArgs e)
{
s_试题筛选 = new S_试题筛选();
this.Controls.Add(s_试题筛选); 《计算机网络》课程通用题库管理系统设计与实现(21):http://www.751com.cn/jisuanji/lunwen_183.html