新手入门,有的东西不懂,望高手给我具体的说下用什么做最好,用到什么东西,最好有现成的代码。。谢谢
解决方案 »
- 多线程问题,在调用一个线程的时候,如何保证界面不死
- timercallback问题请教
- Windows 拖动图标效果
- 求一简单js正则表达式
- php中的“^”与.net “^”是不是一样的
- 新手求用户登录代码
- 如何让Windows服务显示一个Form与用户交互,在线等
- 关于Reporting Service的问题!请大家帮忙!!!
- 请教一个基础问题!关于自定义的namespace在aspx页面引用问题!
- .net framework类库引用出了问题,提示List<int>在.net standard中被定义
- ZEDgraph的下方横向拖动条的问题
- opendialog的filter属性,设置问题
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++;
}
} }
}
}