473,385 Members | 1,325 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Can SaveFileDialog1 return folder?

I want a dialog like SaveFileDialog1 that returns a folder (aka path)
instead of a file name. I have a program that has a file with a file name
already assigned, but I want to allow the user to select the directory to
store it in. Is this possible with a supplied dialog or do I have to create
my own dialog?

Thank you,

Bobbo
Nov 21 '05 #1
4 1923
I sometimes prefer this dialog instead of the BrowseForFolder, because it
lets you see the files.

Just put whatever you want in the .FileName property, something like "Choose
your folder".
Make shure to set .CheckFileExists = False
Then, extract the pathname from the returned .FileName.

Dim pathname As String
With Me.OpenFileDialog1
.CheckFileExists = False
.CheckPathExists = True
.FileName = "Choose your folder"
If .ShowDialog() = DialogResult.OK Then
pathname = System.IO.Path.GetDirectoryName(.FileName)
End If
End With

Best Regards,
Alejandro Lapeyre

"Robert Liles" <rl****@midsouth.rr.com> escribió en el mensaje
news:1A*****************@fe2.columbus.rr.com...
I want a dialog like SaveFileDialog1 that returns a folder (aka path)
instead of a file name. I have a program that has a file with a file name
already assigned, but I want to allow the user to select the directory to
store it in. Is this possible with a supplied dialog or do I have to
create my own dialog?

Thank you,

Bobbo

Nov 21 '05 #2
Robert,

From Version 2003 Net1.1 there is the folderbrowserdialog

http://msdn.microsoft.com/library/de...classtopic.asp

Because that there is bug in it. (with paths longer than 128 positions you
can become in trouble) you have to need Net 1.1 SP1 for that.

I hope tis helps,

Cor
Nov 21 '05 #3
"Robert Liles" <rl****@midsouth.rr.com> schrieb:
I want a dialog like SaveFileDialog1 that returns a folder (aka path)
instead of a file name. I have a program that has a file with a file name
already assigned, but I want to allow the user to select the directory to
store it in.


Displaying the dialog for choosing a directory
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=folderbrowserdialog&lang=en>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #4
Thank you all, that is just what I needed.
Bobbo
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:e7**************@TK2MSFTNGP09.phx.gbl...
"Robert Liles" <rl****@midsouth.rr.com> schrieb:
I want a dialog like SaveFileDialog1 that returns a folder (aka path)
instead of a file name. I have a program that has a file with a file name
already assigned, but I want to allow the user to select the directory to
store it in.


Displaying the dialog for choosing a directory
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=folderbrowserdialog&lang=en>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: jenny | last post by:
Hi, I am trying to find a VB way that would create a folder on all existing drives - the folder name would be the same on each drive. ie c:\backup, d:\backup, etc. But the folders would only be...
1
by: Bob | last post by:
Hi ! I got a problem here ... i used a ShellLinkObject is retrive some data from ..lnk files (path to execute, working directory, etc ...) but i need to get the icon path (in some case this is the...
6
by: Rigga | last post by:
Hi, I am new to Python and am currentky just playing with some simple functions however I can not work out how to return a variable back from a module, probably easier if you see the code.. what...
9
by: Mariam | last post by:
Hi, all, We have mutiple ASP.NET web applications and setup on mutiple web servers (win2k, .netframework 1.1). All the web applications are setup to use Forms authentication. All the applications...
1
by: Morten Snedker | last post by:
I've made myself a class for enumerating folders. But I'm a bit confused how to use it. It looks like this: '--Class begin Imports System.IO Public Class ListFolders Private _folder As...
1
by: tom | last post by:
I have the section of code listed below, but when I return from main an exception is thrown from the library, because while returning, destructor is called on each of the object in the sequence...
2
by: dobbine | last post by:
hi there folks, I was wondering if I have a folder with the following files in it, can I return 00012a.jpg? 00012.jpg 00012a.jpg 00012b.jpg 00012c.jpg right up to ... 00012z.jpg
2
by: zion | last post by:
Hi, I have database with picture locations, for example: c:\temp\test.jpg. How can webservice return picture link? <img width=200 height=150 src='file://c:\\temp\\test.jpg' /> <img width=200...
5
by: Ca1icoJack | last post by:
I'm new to Javascript and want to write a script which will loop through the files in a folder and display them in a webpage. I've written the following which alternately displays two images in a...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.