当前位置:编程学习 > C#/ASP.NET >>

用C#提取word中信息,图片,格式。。。。

新手入门,有的东西不懂,望高手给我具体的说下用什么做最好,用到什么东西,最好有现成的代码。。。。。谢谢 --------------------编程问答--------------------
using System;
using System.Collections.Generic;
using System.Text;
using Word = Microsoft.Office.Interop.Word;
using Microsoft.Office.Interop.Word;

using Microsoft.Office.Core;
using System.Drawing;

using System.Windows.Forms;

namespace Get_pic
{
    class Program
    {
        static void Main(string[] args)
        {
            Word.Application newApp = new Word.Application();
            newApp.Visible = false;
            string sFileName = "C:\\Documents and Settings\\Administrator\\桌面\\abc\\11.doc"; 
            object objFileName = ((object)sFileName);   
           
            object obj = Type.Missing;
            //打开Word文档
            Microsoft.Office.Interop.Word.Document doc = newApp.Documents.Open(ref objFileName, ref obj, ref obj, ref obj, ref obj, ref obj, ref obj, ref obj, ref obj, ref obj, ref obj, ref obj, ref obj, ref obj, ref obj, ref obj);
            
           int count = doc.InlineShapes.Count;
           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("C:\\Documents and Settings\\Administrator\\桌面\\abc");
                   i++;
               }


           }

        }
    }
}
--------------------编程问答-------------------- http://www.baidu.com/link?url=jnZVGJqjJ4zBBpC8yDF8xDhiqyriBV-kCioEb5kFNc3b2ZwpIDtxrtVrBCrt
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,