将ClientDateSet中的图片字段copy到word文档中
var
testStream:TMemoryStream;
JpgFile:TjpegImage;
begin
try
testStream:=TMemoryStream.Create ;
JpgFile:=TjpegImage.Create ;
if not TBlobField(cs.FieldByName('picture')).IsNull then
begin
TBlobField(cs.FieldByName('picture')).SaveToStream(testStream);
testStream.Position :=0;
jpgfile.LoadFromStream(testStream);
Clipboard.Assign(JpgFile);
doc.Range.InsertAfter(' '+#13);
doc.Sentences.Last.Paste; //粘帖到word中
doc.Range.InsertAfter(#13);
end;
finally
testStream.Free;
jpgfile.FREE;
end;
//句子
doc.Sentences
//段落
doc.Paragraphs