PowerPoint FileDialog

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to load a set of questions stored as a text file into a slide in
PowerPoint. I'm using the following code :-

Private Sub Showfiledialog()
'opens File Dialog Box & allows user to choose a file
Dim dlgOpen As FileDialog
Dim vrtSelectedItem As Variant

Set dlgOpen = Application.FileDialog(msoFileDialogOpen)

With dlgOpen
.AllowMultiSelect = False
.Show
.InitialFileName = "c:\documents and Settings\administrator\*.*"
selectedfile = .SelectedItems.Item(1)
End With

Set dlgOpen = Nothing

End Sub

the problem is that this code also opens the application. I call this code
from a command button within PowerPoint. When the user clicks on the command
button it is intended that the text file loads into question boxes. All
works well except that the PowerPoint application also opens. I have to
minimise the application to continue with the test slide.

Any help - what am I doing wrong. I started of with a full head of hair and
now I'm nearly bald. Save my hair PLEASE.

Many thanks Tony
 
The Application.FileDialog(....) tells PowerPoint you will be opening a
PowerPoint presentation. You want a generic file open dialog, I suspect.


This link may be just what you wanted (remember to thank Chirag).
http://officeone.mvps.org/vba/display_file_open_common_dialog.html

--
Bill Dilworth
Microsoft PPT MVP Team
===============
Please spend a few minutes checking vestprog2@
out www.pptfaq.com This link will yahoo.
answer most of our questions, before com
you think to ask them.

Change org to com to defuse anti-spam,
ant-virus, anti-nuisance misdirection.
..
..
 
Thanks very much. With a little tweaking It's working exactly the way I
wanted it to. Thanks again for your help. I'm going to try that site you
suggested.

Tony P
 
Back
Top