抄的网上的一段代码如下:
Object Missing=System.Reflection.Missing.Value;
//取得Word文件保存路径
object [email protected];
//创建一个名为WordApp的组件对象
Word.Application WordApp=new Word.ApplicationClass();
//创建一个名为WordDoc的文档对象
Word.Document WordDoc=WordApp.Documents.Add(ref Missing,ref Missing,ref Missing,ref Missing);
//增加一表格
Word.Table table=WordDoc.Tables.Add(WordApp.Selection.Range,1,1,ref Missing,ref Missing);
//在表格第一单元格中添加自定义的文字内容
table.Cell(1,1).Range.Text=wordText.Text;
//在文档空白地方添加文字内容
WordDoc.Paragraphs.Last.Range.Text="Wellcome To Aspxcn.Com";
//将WordDoc文档对象的内容保存为DOC文档
WordDoc.SaveAs(ref filename,ref Missing,ref Missing,ref Missing,ref Missing,ref Missing,ref Missing,ref Missing,ref Missing,ref Missing,ref Missing,ref Missing,ref Missing,ref Missing,ref Missing,ref Missing);
//关闭WordDoc文档对象
WordDoc.Close(ref Missing, ref Missing, ref Missing);
//关闭WordApp组件对象
WordApp.Quit(ref Missing, ref Missing, ref Missing);
//返回结果
result.Text="文档路径:<a href='"+SaveAs.Text+"'>"+SaveAs.Text+"</a>(点击链接查看)<br>生成结果:成功!";运行后显示错误如下:
异常详细信息: System.Runtime.InteropServices.COMException: 无法打开宏储存。源错误: 
行 103: //创建一个名为WordDoc的文档对象
行 104:
行 105: Word.Document WordDoc=WordApp.Documents.Add(ref Missing,ref Missing,ref Missing,ref Missing);
行 106: WordDoc.Activate();
行 107: //增加一表格
 源文件: c:\inetpub\wwwroot\word\webform1.aspx.cs    行: 105 堆栈跟踪: 
[COMException (0x800a175d): 无法打开宏储存。]
   Word.Documents.Add(Object& Template, Object& NewTemplate, Object& DocumentType, Object& Visible) +0
   word.WebForm1.Button2_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\word\webform1.aspx.cs:105
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
   System.Web.UI.Page.ProcessRequestMain() +1277怎么回事啊?
另外求教:
如何把vba的程序嵌入进去啊。