I use the following method to save an HTML file as a Word file and then query an image.
Object nothing = system. reflection. Missing. value;
Object srcfilename = @ "D: \ aa.html ";
Object dstfilename = @ "D: \ li.doc ";
Object objt = true;
Word. Application wordapp = new word. applicationclass ();
Word. Document worddoc = NULL;
Object format = word. wdsaveformat. wdformatdocument;
Try
{
Worddoc = wordapp. documents. open (ref srcfilename, ref format, ref nothing, ref nothing );
// Image
Word. shape oshape = worddoc. shapes. addpicture ("D: \ dl_01.gif", ref nothing, ref objt, ref nothing, ref nothing );
Oshape. wrapformat. type = word. wdwraptype. wdwrapsquare;
// Save the HTM file as a DOC file
Worddoc. saveas (ref dstfilename, ref format, ref nothing );
}
Finally
{
Worddoc. Close (ref nothing, ref nothing, ref nothing );
Wordapp. Quit (ref nothing, ref nothing, ref nothing );
}
Http://community.csdn.net/Expert/topic/3541/3541955.xml? Temp =. 7204096.