aspx表单文本框值到word.dot书签

时间:2013-10-01 09:07:48

标签: c# asp.net web office-2010

我想知道是否有人有一个快速的解决方案,点击按钮将值从aspx web表单传递到word.dot。我有一个按钮打开我的模板,但我希望它将textbox.text传递给单词模板中的书签

  

例如textbox1.text = bookmark.ID textbox2.text = bookmark.Fname   textbox3.text = bookmark.Lname textbox4.text = bookmark.Address ext ...

protected void Button7_Click(object sender, EventArgs e)
{
    string fPath = @"\\Server12\170912.dot";
    FileInfo myDoc = new FileInfo(fPath);
    Response.Clear();
    Response.ContentType = "Application/msword";
    Response.AddHeader("content-disposition", "attachment;filename=" + myDoc.Name);
    Response.AddHeader("Content-Length", myDoc.Length.ToString());
    Response.ContentType = "application/octet-stream";
    Response.WriteFile(myDoc.FullName);
    Response.End();
  }

一如既往地感谢您

0 个答案:

没有答案