首页 > 代码库 > 图片单独上传 (word)

图片单独上传 (word)

Word.ApplicationClass wordApp=new ApplicationClass();

object file=path;

object nullobj=System.Reflection.Missing.Value;  

Word.Document doc = wordApp.Documents.Open(

ref file, ref nullobj, ref nullobj,  

ref nullobj, ref nullobj, ref nullobj,  

ref nullobj, ref nullobj, ref nullobj,  

ref nullobj, ref nullobj, ref nullobj);

doc.ActiveWindow.Selection.WholeStory();

doc.ActiveWindow.Selection.Copy();

IDataObject data=http://www.mamicode.com/Clipboard.GetDataObject();

string str=data.GetData(DataFormats.Text).ToString();

doc.Close();

来自 <http://bbs.csdn.net/topics/350197270>

图片单独上传 (word)