PickFolder-dialog cancelled

  • Thread starter Thread starter Clouds®
  • Start date Start date
C

Clouds®

Hi all,

I am working on a macro that extracts attachments from all emails in a
folder.
The user has to choose which folder, so I use PickFolder.

Works fine when a folder is selected, but I can't figure out how to detect
that a user cancelled the choose-folder-dialog.
PickFolder then returns 'Nothing', but that can't be used is a comparison.
E.g.

Set SubFolder = ns.PickFolder
If Subfolder = Nothing Then ... End If

returns an error.....

Any hints how to detect this the correct way?

TIA!
 
Sure it can:

If Not SubFolder Is Nothing Then
' you know you have a folder and can proceed
 
Sue Mosher said:
Sure it can:

If Not SubFolder Is Nothing Then
' you know you have a folder and can proceed

Thnxz....it's so easy....why didn't I think of it? :-p
 
Back
Top