其实你创建了ole对象后,每一个对象的操作方法都可以是用比如;
var pp,Presentations,slide:variant;
begin
....
Presentations:=createoleobject('excel.Presentations');
pp:=Presentations.application;
....
slide:=pp.ActivePresentation.Slides.Add(2,ppLayoutText).Select
ActivePresentation.Slides.Add(2,ppLayoutText).Select
就是vba的方法,没什么区别吧?你只要清楚各个对象的关系就行哦,对了,你得将ppLayoutText常量改成数值,否则编译不过去
var pp,Presentations,slide:variant;
begin
....
Presentations:=createoleobject('excel.Presentations');
pp:=Presentations.application;
....
slide:=pp.ActivePresentation.Slides.Add(2,ppLayoutText).Select
ActivePresentation.Slides.Add(2,ppLayoutText).Select
就是vba的方法,没什么区别吧?你只要清楚各个对象的关系就行哦,对了,你得将ppLayoutText常量改成数值,否则编译不过去
var pp,Presentations,slide:variant;
begin
....
Presentations:=createoleobject('excel.Presentations');
pp:=Presentations.application;
....
slide:=pp.ActivePresentation.Slides.Add(2,ppLayoutText).Select
ActivePresentation.Slides.Add(2,ppLayoutText).Select
就是vba的方法,没什么区别吧?你只要清楚各个对象的关系就行哦,对了,你得将ppLayoutText常量改成数值,否则编译不过去
和属性都是类似于应用程序服务器的方法和属性找一本有关vba编程的书,,把那些对象和集合搞懂点先.
你对应于powerpoint的对象声明几个olevariant变量,然后创建它们var pp,Presentations,slide:olevariant; //刚才变量类型错
begin
....
Presentations:=createoleobject('powerpoint.Presentation'); //创建Presentation对象
pp:=Presentations.application; //得到应用实例
pp.visible:=True; //可视
.... //创建其它powerpoint
slide:=pp.ActivePresentation.Slides.Add(2,ppLayoutText).Select
//在当前Presentation添加一张幻灯片
创建对象后你就可以利用这些对象的方法,比如像上一句
(感觉像在重复)
你最好先看一下excel读取数据的帖子,有一些操作方法可以借鉴
Powerpoint.Pressentation相关的对象方法有没有比较全的?我想看看呀~~