PC Review


Reply
Thread Tools Rate Thread

can msoFileDialogFolderPicker display file names in the folder

 
 
Paul C
Guest
Posts: n/a
 
      19th Nov 2009
I am using the following section of code to have a user select a location to
save a newly created file (the name is already determined - newname)

With Application.FileDialog(msoFileDialogFolderPicker)
.Show
newloc = .SelectedItems(1)
End With

ActiveWorkbook.SaveAs Filename:=CStr(newloc) & "\" & newname

Everything works fine, but the FolderPicker only displays folders and no
contents.

While this is not critical, I would like the user to see the folder contents
for reference and it is just bugging me that I can't do this.

I know that changing to FilePicker will do this, but then the user is
picking a name and not using the predetermined newname (which I would
prefer).

Is there a way to have the FolderPicker display the folder content?
or
If using FilePicker how can you force the predetermined name to be used?


--
If this helps, please remember to click yes.
 
Reply With Quote
 
 
 
 
Jacob Skaria
Guest
Posts: n/a
 
      19th Nov 2009
Try the below..Doesnt that odd that the user will have to type or select a
file to get the FilePicker OK button enabled...

Dim strFolder As String
With Application.FileDialog(msoFileDialogFilePicker)
.Show
newloc = .SelectedItems(1)
End With
strFolder = Left(newloc, InStrRev(newloc, "\"))
ActiveWorkbook.SaveAs Filename:=strFolder & newname

If this post helps click Yes
---------------
Jacob Skaria


"Paul C" wrote:

> I am using the following section of code to have a user select a location to
> save a newly created file (the name is already determined - newname)
>
> With Application.FileDialog(msoFileDialogFolderPicker)
> .Show
> newloc = .SelectedItems(1)
> End With
>
> ActiveWorkbook.SaveAs Filename:=CStr(newloc) & "\" & newname
>
> Everything works fine, but the FolderPicker only displays folders and no
> contents.
>
> While this is not critical, I would like the user to see the folder contents
> for reference and it is just bugging me that I can't do this.
>
> I know that changing to FilePicker will do this, but then the user is
> picking a name and not using the predetermined newname (which I would
> prefer).
>
> Is there a way to have the FolderPicker display the folder content?
> or
> If using FilePicker how can you force the predetermined name to be used?
>
>
> --
> If this helps, please remember to click yes.

 
Reply With Quote
 
Jacob Skaria
Guest
Posts: n/a
 
      19th Nov 2009
Set the initial file name to the new name and then Open the dialog

Dim strFolder As String
With Application.FileDialog(msoFileDialogFilePicker)
.InitialFileName = newname
.Show
newloc = .SelectedItems(1)
End With
strFolder = Left(newloc, InStrRev(newloc, "\"))
ActiveWorkbook.SaveAs Filename:=strFolder & newname

If this post helps click Yes
---------------
Jacob Skaria


"Jacob Skaria" wrote:

> Try the below..Doesnt that odd that the user will have to type or select a
> file to get the FilePicker OK button enabled...
>
> Dim strFolder As String
> With Application.FileDialog(msoFileDialogFilePicker)
> .Show
> newloc = .SelectedItems(1)
> End With
> strFolder = Left(newloc, InStrRev(newloc, "\"))
> ActiveWorkbook.SaveAs Filename:=strFolder & newname
>
> If this post helps click Yes
> ---------------
> Jacob Skaria
>
>
> "Paul C" wrote:
>
> > I am using the following section of code to have a user select a location to
> > save a newly created file (the name is already determined - newname)
> >
> > With Application.FileDialog(msoFileDialogFolderPicker)
> > .Show
> > newloc = .SelectedItems(1)
> > End With
> >
> > ActiveWorkbook.SaveAs Filename:=CStr(newloc) & "\" & newname
> >
> > Everything works fine, but the FolderPicker only displays folders and no
> > contents.
> >
> > While this is not critical, I would like the user to see the folder contents
> > for reference and it is just bugging me that I can't do this.
> >
> > I know that changing to FilePicker will do this, but then the user is
> > picking a name and not using the predetermined newname (which I would
> > prefer).
> >
> > Is there a way to have the FolderPicker display the folder content?
> > or
> > If using FilePicker how can you force the predetermined name to be used?
> >
> >
> > --
> > If this helps, please remember to click yes.

 
Reply With Quote
 
Paul C
Guest
Posts: n/a
 
      19th Nov 2009
Thanks,

Both ideas look a little better than the blank FolderPicker method, that
just gives me an odd feeling that I was was doing something, but not quite
sure exactly what.

I like the one with the InitialFileName set even though it then does not
show the files within the folder.
--
If this helps, please remember to click yes.


"Jacob Skaria" wrote:

> Set the initial file name to the new name and then Open the dialog
>
> Dim strFolder As String
> With Application.FileDialog(msoFileDialogFilePicker)
> .InitialFileName = newname
> .Show
> newloc = .SelectedItems(1)
> End With
> strFolder = Left(newloc, InStrRev(newloc, "\"))
> ActiveWorkbook.SaveAs Filename:=strFolder & newname
>
> If this post helps click Yes
> ---------------
> Jacob Skaria
>
>
> "Jacob Skaria" wrote:
>
> > Try the below..Doesnt that odd that the user will have to type or select a
> > file to get the FilePicker OK button enabled...
> >
> > Dim strFolder As String
> > With Application.FileDialog(msoFileDialogFilePicker)
> > .Show
> > newloc = .SelectedItems(1)
> > End With
> > strFolder = Left(newloc, InStrRev(newloc, "\"))
> > ActiveWorkbook.SaveAs Filename:=strFolder & newname
> >
> > If this post helps click Yes
> > ---------------
> > Jacob Skaria
> >
> >
> > "Paul C" wrote:
> >
> > > I am using the following section of code to have a user select a location to
> > > save a newly created file (the name is already determined - newname)
> > >
> > > With Application.FileDialog(msoFileDialogFolderPicker)
> > > .Show
> > > newloc = .SelectedItems(1)
> > > End With
> > >
> > > ActiveWorkbook.SaveAs Filename:=CStr(newloc) & "\" & newname
> > >
> > > Everything works fine, but the FolderPicker only displays folders and no
> > > contents.
> > >
> > > While this is not critical, I would like the user to see the folder contents
> > > for reference and it is just bugging me that I can't do this.
> > >
> > > I know that changing to FilePicker will do this, but then the user is
> > > picking a name and not using the predetermined newname (which I would
> > > prefer).
> > >
> > > Is there a way to have the FolderPicker display the folder content?
> > > or
> > > If using FilePicker how can you force the predetermined name to be used?
> > >
> > >
> > > --
> > > If this helps, please remember to click yes.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Match file names listed in column with file names in folder K Microsoft Excel Programming 1 16th Mar 2009 04:26 PM
Random folder names display ... at the end nsxviper Windows XP Help 1 16th Mar 2009 01:52 PM
Re: file names and folder names have been changed into some values automatically Malke Windows Vista File Management 0 11th Jul 2008 01:10 PM
Opening each file in a folder using msoFileDialogFolderPicker Ayo Microsoft Excel Misc 1 12th Mar 2008 03:41 PM
My Outlook folder names do not display last few characters Donna Microsoft Outlook Discussion 2 26th Nov 2007 05:36 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:03 AM.