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

C# 找不到类型或命名空间名称“Word”(是否缺少 using 指令或程序集引用?)
我编一个简单的程序 ,就是想把 Word中图片的提取 可是 编译一直通不过 ~~~~(>_<)~~~~ 求高手相助 


问题如下:
找不到类型或命名空间名称“Word”(是否缺少 using 指令或程序集引用?) C:\Users\MBL\Desktop\picture viewer1.2\picture using

 
部分源码:
System;
using Word;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
......
......

  private void StartButton_Click(object sender, EventArgs e)
  {
  Word.Application newApp = new Word.Application();
  Word.Document doc = newApp.Documents.Open(this.textPathBox.Text);
  int i = 0;
  foreach (Word.InlineShape ish in doc.InlineShapes)
  {
  if (ish.Type == Word.WdInlineShapeType.wdInlineShapePicture)
  {
  ish.Select();
  newApp.Selection.Copy();
  Image image = Clipboard.GetImage();

  Bitmap bitmap = new Bitmap(image);
  bitmap.Save(this.textTargetBox.Text + i.ToString() + ".jpg");
  i++;
  }
  }


  }



------解决方案--------------------
要先运行REGASM注册PIA,才能引用。