FileDialog

P

Phil

Hi all,

Using Outlook 2K and am struggling to display an openfile box to let a user
select a text file to import names-address pairs in a distribution list.

Outlook XP seems to use a FileDialog collection, which I can't make work and
Outlook 2K doesn't seem to have it...

Anyone to help me, poor beginner with Outlook VBA???

Thx

Phil
 
K

Ken Slovak - [MVP - Outlook]

If you want to use the standard Windows File Open dialog it's in one
of the Windows common controls. It's called the Microsoft Common
Dialog Control (comdlg32.ocx).

In your code you would use something like this:
Dim objCommonDialog1 As CommonDialog

'set properties for common dialog like Filter, DialogTitle,FileName,
DefaultExt, FileTitle, etc.
objCommonDialog1.ShowOpen

However, that control is only available for your development use if
you have Office Developer or VB6. Otherwise you'd have to construct
your own dialog and get/set all the properties you want to use for the
dialog.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Lead Author, Beginning VB 6 Application Development, Wrox Press
Attachment Options
http://www.slovaktech.com/attachmentoptions.htm
Extended Reminders
http://www.slovaktech.com/extendedreminders.htm
 
K

Ken Slovak - [MVP - Outlook]

I don't know how far back you go with the versions of Windows you use,
but comdlg32.ocx should certainly be there, especially if Office is
installed. Office uses that OCX for its own file open/save/etc.
operations. I've never had to distribute it for my apps.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Lead Author, Beginning VB 6 Application Development, Wrox Press
Attachment Options
http://www.slovaktech.com/attachmentoptions.htm
Extended Reminders
http://www.slovaktech.com/extendedreminders.htm
 
P

Phil

I don't know how far back you go with the versions of Windows you use,
but comdlg32.ocx should certainly be there, especially if Office is
installed. Office uses that OCX for its own file open/save/etc.
operations. I've never had to distribute it for my apps.

True...I'm using W2K...I was just trying to stick with Office-type stuff. It
actually works with Excel or Word Dialogs collection, excepted you can't set
any Z-order property and the Dialogs box stays in the background until you
Alt-Tab!! Weird...I'll follow your advice and use common control ((-;

Thanks Ken,

Best regards from Paris, France
 

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