我想做这样一个程序:
窗体中有一个OleContainer1,当你把一个文件,比如说是Word文件拖放到他上面时,就能显示出这个文件的内容,可是,不知道怎么编写,我想应该是在OleContainer1的OnDragDrop事件中编写代码,我是这样写的:
procedure TForm1.OleContainer1DragDrop(Sender, Source: TObject; X,
  Y: Integer);
begin
if source is TWordDocument then
begin
   with source as TWordDocument do
   self.OleContainer1.CreateObjectFromFile(source);
   self.OleContainer1.Run;
end;可是却总提示类型不匹配,我不知道该怎么做才能获得拖动文件名,请大家帮我想想办法!