【问题标题】:Powerpoint VBA Macro Save As Dialog File FilterPowerpoint VBA 宏另存为对话框文件过滤器
【发布时间】:2014-03-27 11:00:46
【问题描述】:

我想将 PPT 演示文稿导出为 .html 文件。因此我有 VBA 代码

Sub HTMLExport()
    ActivePresentation.SaveAs "C\Users\test\pptInHtml.htm", ppSaveAsHTML, msoFalse
End Sub

这可行,但我需要“另存为对话框”的代码,用户可以在其中选择文件将保存为 html 的路径(用户只能选择“另存为 html”,仅此而已) .

这是我的 SaveAsDialog 的代码

Sub ShowSaveAsDialog()
Dim dlgSaveAs As FileDialog
Set dlgSaveAs = Application.FileDialog(msoFileDialogSaveAs)
With dlgSaveAs
  If .Show = -1 Then
    .Execute
  End If
End With
End Sub

但现在,我需要 .html 文件的文件过滤器。

【问题讨论】:

    标签: vba powerpoint savefiledialog filefilter


    【解决方案1】:

    MS Office SaveAs type FileDialog with a filter in vb 声明自定义过滤器很遗憾不能用于“另存为”对话框。

    所以看起来最好的选择是使用Windows API 来创建对话框,正如 OP 所建议的那样。

    【讨论】:

      猜你喜欢
      • 2017-05-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-04-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多