PickFolder-dialog cancelled

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!
 
S

Sue Mosher [MVP-Outlook]

Sure it can:

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

Clouds®

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top