中国开发网: 论坛: Delphi/BCB: 贴子 664656
pcplayer: 让 PowerPoint 另存文件
use COMObj, Office2000, PowerPointXP;

其中 Office2000, PowerPointXP 在 C:\Program Files\Borland\Delphi7\Ocx\Servers

procedure TForm1.Button3Click(Sender: TObject);
var
PP: Variant;
EM: OleVariant;
begin
try
PP := GetActiveOleObject('PowerPoint.Application'); //如果 PowerPoint 已经运行,则这句话就拿到了.
except
PP := CreateOleObject('PowerPoint.Application'); //如果 PP 没运行,则走到这里来.
end;

PP.Visible := True; //一定要 True ,没显示出来,以下操作都不行.
PP.Presentations.Open('C:\123.ppt', msoFalse, msoFalse, msoTrue);

EM := False;
PP.ActivePresentation.SaveAs('C:\1234.EMF', ppSaveAsEMF, EM);
PP.ActivePresentation.Close; //关掉打开的文件
PP.Quit;//关掉PP 程序
end;

相关信息:


欢迎光临本社区,您还没有登录,不能发贴子。请在 这里登录