如何用自己的程序,把图片插入到PowerPoint中,并且合成为PPT文件(300分)

  • 主题发起人 主题发起人 壹平
  • 开始时间 开始时间

壹平

Unregistered / Unconfirmed
GUEST, unregistred user!
[red][/red]如何用自己的程序,把图片插入到PowerPoint中,并且合成为PPT文件
 
试试下面的
var c:TClipboard;
atype,tmp:olevariant;
begin
try
try
PowerPointApplication1.Connect;
except on E: Exception do
begin
E.Message := 'PowerPoint does not appear to be installed';
raise;
end;
end;
PowerPointApplication1.Visible := 1;
Form1.SetFocus;
PowerPointPresentation1.ConnectTo(PowerPointApplication1.Presentations.Add(1));
PowerPointSlide1.ConnectTo(PowerPointPresentation1.Slides.Add(PowerPointPresentation1.Slides.Count + 1, 1));

with PowerPointSlide1 do
begin
Layout := 10;
FollowMasterBackground := 0;
Background.Fill.PresetGradient(2, 2, 10);
Shapes.Item(1).TextFrame.TextRange.InsertAfter('test');
c:=TClipboard.Create;
c.Assign(Image1.Picture.Bitmap);
Shapes.Paste;
{Set time displayed for each slide}
SlideShowTransition.AdvanceOnTime := 1;
SlideShowTransition.AdvanceTime := 2;
c.Free;
tmp:=True;
atype:=ppSaveAsPowerPoint7;
caption:=self.PowerPointPresentation1.GetNamePath;
self.PowerPointPresentation1.SaveAs('c:/1.ppt',atype,tmp);
end;
except
on E: Exception do
begin
Showmessage(E.Message);
PowerPointApplication1.Disconnect;
end;
end;
end;
 
后退
顶部