I am trying to open a SAVE AS FileDialog in OUTLOOK (MS Office 2013 or 2016). Since Outlook does not support FileDialogs, I use Excel (this seems to be the preferred approach based on dozens of searches).
I have had success opening a FilePicker dialog (msoFileDialogFilePicker) and File Open, but I just cannot get this to work for a SaveAs dialog (msoFileDialogSaveAs).
Could anyone please explain why the SaveAs does not work, but the FilePicker does. Or, could someone explain what I am doing wrong.
Here is some sample code. Each of These DOES Work:
Dim xlobj As Excel.Application
Set xlobj = New Excel.Application
Dim objDialog As FileDialog
Set objDialog = xlobj.FileDialog(msoFileDialogOpen) 'This WORKS
Set objDialog = xlobj.FileDialog(msoFileDialogFolderPicker) ' This Works too
Set objDialog = xlobj.FileDialog(msoFileDialogFilePicker) ' This also works
objDialog.Show
HOWEVER, when I try to use msoFileDialogSaveAs I get an Error (Error -Automation Error The remote procedure call failed).
Dim xlobj As Excel.Application
Set xlobj = New Excel.Application
Dim objDialog As FileDialog
Set objDialog = xlobj.FileDialog(msoFileDialogSaveAs) ' This throws ERROR???
I would welcome any ideas or onsights.
Thanks very much,
DGP
PS. In case its relevant. The user needs to save some of their email messages in a Legal Folder. I have built a way to Save them directly using the Sender or Recipient and a date stamp as the file name. For this use case, they want a File Dialog so that they can manually name the File they are about to save.