PPTX 2007 - VBA:如果我从表单后面的访问代码创建一个powerpoint pres,那么我如何提示在结束时保存ppt文件

时间:2010-06-24 13:47:26

标签: ms-access vba automation powerpoint

我有一个访问表单,可以从访问表单/表格中的信息创建一个ppt文件(幻灯片组)。我在实用程序文件夹中使用模板文件,该文件夹与访问文件本身位于同一文件夹中。一切都很好,除了一小块。

我想知道在运行创建ppt的子例程中的其他所有内容之后,我怎样才能使新创建的ppt文件提示将文件保存为除template.ppt之外的其他内容。

我认为像

   ppt.save

的工作原理。但是我需要一些像“另存为”的东西......甚至是可能的默认值。

非常感谢....我无法幸运地绊倒这一个。

贾斯汀

1 个答案:

答案 0 :(得分:2)

怎么样:

Dim dlgSaveAs As FileDialog
Dim strMyFile As String

Set dlgSaveAs = Application.FileDialog(fileDialogType:=msoFileDialogSaveAs)
With dlgSaveAs
    .InitialFileName = "Presentation2_" & Format(Date, "yyyy-mm-dd")
    If .Show = -1 Then
        strMyFile = .SelectedItems(1)
        MsgBox strMyFile
        ''-- save your file to strMyFile here
    ''Else
        ''-- The user pressed Cancel.
    End If
End With
Set dlgSaveAs = Nothing

来自:http://www.vbforums.com/showthread.php?t=521968