user3004279
user3004279

Reputation: 41

MS Word SaveAs File Dialog with filters

I want to save a custom file from VBA code under Microsoft Word. Is there an appropriate SaveAs dialog in Word VBA? What I need from this dialog:

  1. to specify a custom filter;
  2. to select a file that (probably) does not exist;
  3. use Word VBA only if possible.

Solutions I found on this site:

  1. Application.FileDialog(msoFileDialogSaveAs). Doesn't allow to specify a custom filter.
  2. Application.FileDialog(msoFileDialogFolderPicker). Doesn't allow to select a file that does not exists (this is a File Open dialog, not a File SaveAs one).
  3. Application.GetSaveAsFilename. Works in Excel, but absent in Word.
  4. Using Windows API. I want to avoid this if it is possible.
  5. Calling an Excel application from Word VBA and use GetSaveAsFilename. Ugly solution. Is there any other way?

Upvotes: 4

Views: 1084

Answers (1)

Pierre Arlaud
Pierre Arlaud

Reputation: 4131

Is Word Interop an acceptable alternative to you ? If so you can use SaveAs of the Document class.

Upvotes: 0

Related Questions