Folder Select Dialog

I am currently using FolderBrowserDialogto select a folder in my .NET solution. However, this dialog box does not allow me to select SharePoint folders, only local or network folders.

I would like to use something similar to SaveFileDialogor OpenFileDialogbecause they allow you to browse SharePoint folders. However, these options require that you specify or select a specific file, not a folder.

Is there a way to use create a folder selection similar to SaveFileDialogor OpenFileDialog? Ideas in VB.NET or C # are welcome.

UPDATE:

As a workaround, I now use the folder collector from the Office application, for example:

app.FileDialog(Office.MsoFileDialogType.msoFileDialogFolderPicker)

where appcan be the object of the application Excel, PowerPoint, Word, etc. I still prefer not to reference the Office application to remove this, but this is the only option I have found so far. I did not present this as an answer, because I hope for a real solution, not a workaround.

+4
source share
1 answer

If OpenFileDialog and SaveFileDialog work for you, you can select a file and then use the C # command

Path.GetDirectoryName (path_to_file); or in VB.net Path.GetDirectoryName (path_to_file)

I don’t know if it fills your needs ... It depends on where you need this code, and if the folder is empty or not, as you know, if the folder is empty, this method will not work

,

Office.MsoFileDialogType

0

Source: https://habr.com/ru/post/1605771/


All Articles