请问如何根据图片路径把图片导出到word? [

解决方案 »

  1.   

    var WordApp  :Variant;
        WordPic  :Variant;
    begin
      WordApp := CreateOleObject('Word.Application');
      try
         WordApp.Visible := True;
         WordApp.Activate;
         if WordApp.Documents.Count = 0 then WordApp.Documents.Add;
         WordPic := WordApp.ActiveDocument.Shapes.AddPicture(Filename, False, True);
      finally
         WordApp := Unassigned;
      end;
    end;//切记:Ole操作调试时会发生异常,编译后执行才会正确!