如何不通过olecontrainer,直接调用WordApplication将word字段用stream流方式放入word窗口中编辑?(100分)

  • 主题发起人 basicshen
  • 开始时间
B

basicshen

Unregistered / Unconfirmed
GUEST, unregistred user!
我用以下代码实现了将数据库中的word二进制字段用流方式放入olecontrainer中显示。
但是在窗体的olecontrainer中编辑word不方便,我想不通过olecontrainer,直接调用
WordApplication将word字段用流方式放入word窗口中编辑,就像平时在Word中的操作
完全一样,最好能在Word菜单中添加“保存到数据库”菜单项,以便将修改后的文件再
以流方式存入数据库中二进制字段中。该如何编写,请附上代码。
procedure TForm.Button1Click(Sender: TObject);
var
oleStream:Tstream;
begin
query1.Edit;
OleStream:= query1.CreateBlobStream(query1.FieldByName('blob'),bmreadwrite);
olecontrainer1.LoadFromStream(oleDY);
olecontrainer1.DoVerb(ovshow);
oleStream.free;
end;
 
如果你急用的话,可以使用copy
sendmessage(olecontrainer1.handle,wm_selall,0,0)
sendmessage(olecontrainer1.handle,wm_copy,0,0)
然后在word里粘贴
 
如何调出word,并粘贴?
 
顶部