PowerPoint VBA另存为对话框文件过滤器

时间:2016-06-03 22:29:50

标签: vba powerpoint-vba

如何在PowerPoint VBA中设置1个或多个“另存为”对话框文件过滤器?这是我的代码:

Private Sub save_file_Click()
Dim fd As FileDialog
Dim clicked As Boolean
Set fd = Application.FileDialog(msoFileDialogSaveAs)
With fd
    .InitialFileName = ActivePresentation.path & "\*.note"
    .AllowMultiSelect = False
    .ButtonName = "Save"
    .Title = "Save File"
    '-- Normal Filters are not allowed on FileDialogSaveAs --
    '.Filters.Clear
    '.Filters.Add "Note Files", "*.note"
    '.Filters.Add "Text Files", "*.txt"
    '.Filters.Add "All Files", "*.*"
End With
clicked = fd.Show
If clicked Then
    Open fd.SelectedItems(1) For Input As #1
    Print #1, text_box.Text
    Close intFileNum
End If
End Sub

任何想法?

如果它有所不同:我不是要尝试将ppt导出为HTML,而是在用户表单(窗口)中保存自定义文件(.note)。

0 个答案:

没有答案