.PPT宏启用了显示路径



我正试图在PowerPoint中将演示文稿保存为启用宏的演示文稿,但在保存时遇到了问题。当我保存为启用宏观的演示文稿时,我使用的代码效果很好,但不是启用宏的展示:

Dim oPPTApp As PowerPoint.Application
Dim oPPRFile As PowerPoint.Presentation
Dim oPPTShape As PowerPoint.PlaceholderFormat
Dim oPPTSlide As PowerPoint.Slide
Set oPPTApp = CreateObject("PowerPoint.Application")
oPPTApp.Visible = msoTrue
'opening an existing presentation
Dim spath2 As String
Dim strpath2 As String
spath2 = ActivePresentation.Path <--
strpath2 = spath2 + "ResourcesAIT DiplomasAIT Diplomas.pptx"

问题是,当我将其保存为启用宏的节目并尝试运行时,它会在<---处停止代码行,因为"没有活动的演示文稿。当您将powerpoint保存为启用宏的演示文稿时,不会打开"演示文稿"(powerpoint窗口),只有幻灯片窗口。

我需要一种方法来找到不引用不存在的活动演示的活动显示路径。

感谢您抽出时间!

尊敬的Dustin

由于您还没有回答我关于代码在哪里运行FROM的问题,我将假设它来自PPT,并且不涉及其他应用程序。在这种情况下,无论是从PPTM还是PPSM:,这都很好

Sub MittedForYourApproval()
' if the code is running within PPT, you don't need to do it this way:
' PPT has a reference to itself.
'Dim oPPTApp As PowerPoint.Application
'Dim oPPRFile As PowerPoint.Presentation
'Dim oPPTShape As PowerPoint.PlaceholderFormat
'Dim oPPTSlide As PowerPoint.Slide
Dim oPPRFile As Presentation
' I don't know where you're going with this
' but PlaceholderFormat <> a shape
Dim oPPTShape As PlaceholderFormat
Dim oPPTSlide As Slide
'Set oPPTApp = CreateObject("PowerPoint.Application")
'oPPTApp.Visible = msoTrue
'opening an existing presentation
Dim spath2 As String
Dim strpath2 As String
spath2 = ActivePresentation.Path '<--
'strpath2 = spath2 + "ResourcesAIT DiplomasAIT Diplomas.pptx"
MsgBox spath2
End Sub

相关内容

  • 没有找到相关文章

最新更新