Show Dialog of File/Directory

B

B Tuohy

In a userform I would like to allow users to select what picture to display
in an image control, and plan to use LoadPicture() to do it. Question: What
is the dialog that I can use to get file directory information, as follows:

mypict = Application.Dialogs(xlDialogXXXXXXXX).Show
Image1.picture = LoadPicture(mypict)

What is the xlDialog?

Thank you!
 
T

Tom Ogilvy

you can't use Application.Dialogs to get the filename - it would just open
the file

use Application.GetOpenfileName()

Dim mypict as String
mypict = application.GetOpenfileName()
if mypict <> "False" then
image1.picutre = loadPicture(mypict)
End if
 
B

B Tuohy

How does one refresh the userform? The image doesn't appear in the image
control unless I deactivate or hide the application window and/or userform
itself. Any clues?
Thanks for help, T.O.!

BT
 
R

Rob van Gelder

BT,

Dim mypict As String
mypict = Application.GetOpenFilename()
If mypict <> "False" Then
Image1.Picture = LoadPicture(mypict)
End If
Me.Repaint

Rob
 
K

kalel_rojin

Where can I find a list of all Application.Dialogs(xlDialog****).Sho
commands?
I know the Send Mail as Attachment command "File->Send To->Mai
Recipient (as Attachment)" i
Application.Dialogs(xlDialogSendMail).Show
but the command I want is the one right above that in the menu
"File->Send To->Mail Recipient"
Please hel
 
D

Dave Peterson

in VBA's help.

You can search for: BuiltIn;dialog;argument;list;

(or you could drill your way through the help for dialogs.)
 

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