日期:2014-05-17  浏览次数:20957 次

求教VS2008中Microsoft.Office.Interop.Word的问题!
我想编写一个建立WORD文档的程序,我用的是VS2008 ,我看网络上介绍说Microsoft.Office.Interop.Word应该在COM中,但我是在.NET中找到的,然后我每次调试的时候会弹出“从 IClassFactory 为 CLSID 为 {000209FF-0000-0000-C000-000000000046} 的 COM 组件创建实例失败,原因是出现以下错误: 80010001。”的提示,不知道是什么原因,以下我的代码:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.Office.Core;
using Word=Microsoft.Office.Interop.Word; //这个引用我是在,我看网上人们说这个,但没有找到。

namespace zm3
{
  public partial class Form1 : Form
  {
  public Form1()
  {
  InitializeComponent();
  }

  private void Form1_Load(object sender, EventArgs e)
  {
  object oMissing = System.Reflection.Missing.Value;
  Word.Application oWord;
  Word.Document oDoc;
  oWord = new Word.Application();
  oWord.Visible = true;
  oDoc = oWord.Documents.Add(ref oMissing, ref oMissing,ref oMissing, ref oMissing);

  }
  }
}
请高手帮帮忙!

------解决方案--------------------
你有没有正确安装Word呢?
------解决方案--------------------
你有没有正确安装Word呢?
------解决方案--------------------
安装word 或者 找到word的DLL 直接放到项目里 再引用