Outlook: FileDialog object error
Am writing a small routine in Outlook 2010 vba. Intension routine is for users to select the location (folder) where they want to save selected messages. To do the job I I want to use the FileDialog object. The routine looks:
Public Sub ....
Dim fdFolder As Office.FileDialog
Set fdFolder = Application.FileDialog(msoFileDialogFolderPicker)
I get an error on row: Set fdFolder .....
(Runtime error 438. Object doesn't support this property or method)
Reference to Office Object Library is ok.
What is wrong?
Here's a really awkward workaround, but it might give you an idea of how to do what you want. Since Outlook doesn't seem to support the FileDialog object, use one of the other Office apps as a "surrogate".
'=========== BEGIN CODE ===========
Public Sub TestFileDialog()
Dim otherObject As Excel.Application
Dim fdFolder As office.FileDialog
Set otherObject = New Excel.Application
otherObject.Visible = False
Set fdFolder = otherObject.Application.FileDialog(msoFileDialogFolderPicker)
Set otherObject = Nothing