现在word中画表格,再往指定格子里面放图片
var
filepath,range,wordTable
levariant;
FPicture:OleVariant;
filepath:='d:/456.doc';
try
WordApplication1.Connect;
WordApplication1.Visible:=true;
WordDocument1.ConnectTo(WordApplication1.Documents.Open(filepath,
EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,
EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam));
Wordtable:=WordDocument1.Tables.Item(1);
range:=WordDocument1.Tables.Item(1).cell(1,2).range;
//这就是加放入图片的语句
range.InlineShapes.AddPicture('d:/二叉树遍历用图.jpg',False,True);
showmessage('图片已经插入到指定表各中');
finally
WordDocument1.Close;
WordDocument1.Disconnect;
WordApplication1.Quit;
WordApplication1.Visible:=false;
WordApplication1.Disconnect;
end;