0

ボタンをクリックしてaspx Webフォームからword.dotに値を渡す簡単な解決策があるかどうか疑問に思っていました。テンプレートを開くボタンがありますが、word テンプレートのブックマークに textbox.text を渡したいと思います

例: textbox1.text = ブックマーク.ID textbox2.text = ブックマーク.Fname textbox3.text = ブックマーク.Lname textbox4.text = ブックマーク.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();
  }

いつもありがとうございます

4

0 に答える 0