任何人都可以将代码发送给我,如何使用 vbscript 在现有的 power point 中添加文本?
提前致谢。
检查这些文章中的一些指针:
如何使用 Visual Basic 自动化 PowerPoint - Microsoft 支持 Microsoft Kb kb/555191
代码的基础是这样的:
Dim oPPt, oPPs
Set oPPt = CreateObject("PowerPoint.application")
oPPt.Visible = True
' Assuming your adding it to an existing powerpoint : '
Dim sPPtFile: sPPtFile = "C:\yourPowerpoint.pptx"
Set oPPs = oPPt.Presentations.Open(sPPtFile)
Dim oSlide
Set oSlide = oPPs.Slides.Add(1, 2)
oSlide.Shapes(1).TextFrame.TextRange.Text = "My first slide "
oPPTFile.SaveAs "C:\yourPowerpointUpdated.pptx"
oPPt.quit
set oPPt = nothing