asp我不懂,这里是asp.net下对word的操纵
首先要添加对word的引用
private void Button1_Click(object sender, System.EventArgs e)
{
Object oMissing = System.Reflection.Missing.Value; Word.Application Word_App=new Word.Application();
Word.Document Word_doc=new Word.Document();
Word.Documents Docs = Word_App.Documents;
Word._Document my_Doc= (Word._Document) Word_doc;
Word_doc=Docs.Add(ref oMissing, ref oMissing, ref oMissing, ref oMissing);
Word_App.Visible =true;
object start = 0;
object end = 0;
Word.Range range = Word_doc.Range(ref oMissing,ref oMissing);
range.Text="asp.net操纵Word文档示例\n\n欢迎探讨\n ";
}
首先要添加对word的引用
private void Button1_Click(object sender, System.EventArgs e)
{
Object oMissing = System.Reflection.Missing.Value; Word.Application Word_App=new Word.Application();
Word.Document Word_doc=new Word.Document();
Word.Documents Docs = Word_App.Documents;
Word._Document my_Doc= (Word._Document) Word_doc;
Word_doc=Docs.Add(ref oMissing, ref oMissing, ref oMissing, ref oMissing);
Word_App.Visible =true;
object start = 0;
object end = 0;
Word.Range range = Word_doc.Range(ref oMissing,ref oMissing);
range.Text="asp.net操纵Word文档示例\n\n欢迎探讨\n ";
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货