【发布时间】:2014-02-07 15:16:22
【问题描述】:
我有以下代码:
Sub ppt()
Dim pptapp As PowerPoint.Application
Dim ppt As PowerPoint.Presentation
Dim slide As PowerPoint.slide
Dim shape As PowerPoint.shape
Dim var1 As String
Set pptapp = CreateObject("Powerpoint.Application")
pptapp.Visible = True
Set ppt = pptapp.Presentations.Open("X:\SSC_HR\SENS\Bedrijfsbureau\Rapportages\SENS referenten rapportage\Nieuwe ref rap template\SENS referent rapportage januari 2014.pot")
Set slide = ppt.Slides(1)
Set shape = slide.Shapes.AddTextbox(msoTextOrientationHorizontal, 100, 500, 100, 100)
var = InputBox("Insert weeknumber")
With shape
.TextFrame.TextRange = "Update call Jeroen van Breda Vriesman/Ton van der Linden" & vbNewLine & var1 & vbNewLine & "Tel nr: +31 (0)10 - 299 1002 code 59790989 "
.Line.Visible = True
.Width = 200
.Height = 200
.TextEffect.FontSize = 12
End With
With ppt
.SaveAs "C:\Documents and Settings\aa471714\Desktop\" & "SENS referentenrapporge - week" & var1
.Close
结束
结束子
我有两个问题
-
我尝试使用这个语句来安排字体大小
.TextEffect.FontSize = 12
但这不起作用。任何人都知道这里出了什么问题。如果我在没有这条线的情况下运行它一切顺利。
-
如果我现在运行它,我必须插入一个数字。但是那个数字并没有出现在文件中。我已经尝试将昏暗更改为
将 var1 调暗为数字
我收到一个错误,即未定义用户定义的类型。有人知道这里出了什么问题吗?
【问题讨论】:
标签: vba powerpoint