图片的插入可以试试用... public { Public declarations } wordapp:variant; implementation uses ComObj; ------------------------------ wordapp:=CreateOLEObject('Word.Application'); WordApp.visible:=true; image1.Picture.LoadFromFile('d:\leon\rpt\1.bmp'); ClipBoard.Assign(image1.Picture.Bitmap); WordApp.Documents.Item(1).Books.Item('img1').range.paste;
function PrnWordInsert(var imgInsert:TImage;sBookMark:String=''):boolean;var wRange:Variant;iRangeEnd:Integer;begin try if sBookMark='' then begin //在文档末尾 iRangeEnd:=wDoc.Range.End-1; if iRangeEnd<0 then iRangeEnd:=0; wRange:=wDoc.Range(iRangeEnd,iRangeEnd); end else begin //在书签处 wRange:=wDoc.Range.Goto(wdGoToBook,,,sBookMark); end; if imgInsert.Picture.Graphic<>nil then begin Clipboard.Assign(imgInsert.Picture); wRange.Paste; end else begin wRange.InsertAfter('照片'); end; result:=true; except result:=false; end;end;
public
{ Public declarations }
wordapp:variant;
implementation
uses ComObj;
------------------------------
wordapp:=CreateOLEObject('Word.Application');
WordApp.visible:=true;
image1.Picture.LoadFromFile('d:\leon\rpt\1.bmp');
ClipBoard.Assign(image1.Picture.Bitmap);
WordApp.Documents.Item(1).Books.Item('img1').range.paste;
//olecWord OleContainer还有很多操作,可以参看VBA。office安装带有。