用vbs 编辑ppt,可以吗

[复制链接]
查看11 | 回复1 | 2011-4-20 09:04:33 | 显示全部楼层 |阅读模式
想用vbs做一个脚本,包括1.新建ppt文件,2.编辑,比较简单的编辑就可以
回复

使用道具 举报

千问 | 2011-4-20 09:04:33 | 显示全部楼层
<pre id=\"best-answer-content\" class=\"reply-text mb10\">Set objPPT = CreateObject(\"PowerPoint.Application\")
objPPT.Visible = True
Set objPresentation = objPPT.Presentations.Add
objPresentation.ApplyTemplate(\"C:\\Program Files\\Microsoft Office\\Templates\\Presentation Designs\\Globe.pot\")

strComputer = \".\"
Set objWMIService = GetObject(\"winmgmts:\\\\\" defds123 strComputer defds123 \"\\root\\cimv2\")
Set colProcesses = objWMIService.ExecQuery(\"Select * From Win32_Process\")

For Each objProcess in colProcesses

Set objSlide = objPresentation.Slides.Add(1,2)

Set objShapes = objSlide.Shapes


Set objTitle = objShapes.Item(\"Rectangle 2\")

objTitle.TextFrame.TextRange.Text = objProcess.Name


strText = \"Working set size: \" defds123 objProcess.WorkingSetSize defds123 vbCrLf

strText = strText defds123 \"Priority: \" defds123 objProcess.Priority defds123 vbCrLf

strText = strText defds123 \"Thread count: \" defds123 objProcess.ThreadCount defds123 vbCrLf


Set objTitle = objShapes.Item(\"Rectangle 3\")

objTitle.TextFrame.TextRange.Text = strText
Next

objPresentation.SaveAs(\"C:\\Scripts\\Process.ppt\")
objPresentation.Close
objPPT.Quit
来吧楼主,不要犹豫了,采纳吧。
有问题再沟通!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行