我有一个访问表单,可以从访问表单/表格中的信息创建一个ppt文件(幻灯片组)。我在实用程序文件夹中使用模板文件,该文件夹与访问文件本身位于同一文件夹中。一切都很好,除了一小块。
我想知道在运行创建ppt的子例程中的其他所有内容之后,我怎样才能使新创建的ppt文件提示将文件保存为除template.ppt之外的其他内容。
我认为像
ppt.save
的工作原理。但是我需要一些像“另存为”的东西......甚至是可能的默认值。
非常感谢....我无法幸运地绊倒这一个。
贾斯汀
答案 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