Click here to Skip to main content
15,887,683 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Memory usage Pin
Luc Pattyn4-Feb-10 4:09
sitebuilderLuc Pattyn4-Feb-10 4:09 
GeneralRe: Memory usage Pin
cstrader2324-Feb-10 9:48
cstrader2324-Feb-10 9:48 
GeneralRe: Memory usage Pin
Luc Pattyn4-Feb-10 9:58
sitebuilderLuc Pattyn4-Feb-10 9:58 
QuestionCall function in VBA (Access 2007) Pin
misCafe20-Jan-10 17:06
misCafe20-Jan-10 17:06 
AnswerRe: Call function in VBA (Access 2007) Pin
_Damian S_20-Jan-10 17:27
professional_Damian S_20-Jan-10 17:27 
AnswerRe: Call function in VBA (Access 2007) Pin
Steven J Jowett21-Jan-10 10:19
Steven J Jowett21-Jan-10 10:19 
GeneralRe: Call function in VBA (Access 2007) Pin
misCafe21-Jan-10 13:19
misCafe21-Jan-10 13:19 
QuestionExport folder directory listing to Excel with Hyperlinks Pin
cavana120-Jan-10 4:11
cavana120-Jan-10 4:11 
Hi guys,

This is my first posting on here, be gentle!

Bit of a novice really but need some help.

I'm re-doing a work's Document Repository and I need the following out of this bit of code:

- List a folder contents: Done
- Import the folder contents to an array list: Done
- Extract the Name, FullName and CreationDate only: Need Help
- Make the FullName a clickable Hyperlink: Need Help
- Export the Name, CreationDate and FullName Hyperlinks to Excel: Need Help

Thanks to you all! Keep up the good work on this site.

Cav

The code snipet so far is below:

-------------------------------------------------------------------------------------------------------
Public Class frmMain

Dim hyperarray As New ArrayList
Private m_da_Addresses As OleDbDataAdapter
Private m_DataSet As DataSet


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBrowseOpen.Click

Dim basepath As String
Dim array As New ArrayList

' Declare a variable named theFolderBrowser of type FolderBrowserDialog.
Dim theFolderBrowser As New FolderBrowserDialog

' Set theFolderBrowser object's Description property to
' give the user instructions.
theFolderBrowser.Description = "Please select a folder for the download."

' Set theFolderBrowser object's ShowNewFolder property to false when
' the a FolderBrowserDialog is to be used only for selecting an existing folder.
theFolderBrowser.ShowNewFolderButton = False

' Optionally set the RootFolder and SelectedPath properties to
' control which folder will be selected when browsing begings
' and to make it the selected folder.
' For this example start browsing in the Desktop folder.
theFolderBrowser.RootFolder = System.Environment.SpecialFolder.Desktop

' Default theFolderBrowserDialog object's SelectedPath property to the path to the Desktop folder.
theFolderBrowser.SelectedPath = My.Computer.FileSystem.SpecialDirectories.Desktop

' If the user clicks theFolderBrowser's OK button..
If theFolderBrowser.ShowDialog = Windows.Forms.DialogResult.OK Then

' Set the FolderChoiceTextBox's Text to theFolderBrowserDialog's
' SelectedPath property.
tbOpenFolder.Text = theFolderBrowser.SelectedPath
basepath = theFolderBrowser.SelectedPath
End If

RecursiveSearch(basepath, array)


End Sub

Private Sub RecursiveSearch(ByRef basepath As String, ByRef array As ArrayList)

Dim int As Integer = 0
Dim dirInfo As New IO.DirectoryInfo(basepath)
' Try to get the files for this directory
Dim pFileInfo() As IO.FileInfo
Dim ooo As String

ooo = dirInfo.FullName

Try
pFileInfo = dirInfo.GetFiles()

Catch ex As UnauthorizedAccessException
MessageBox.Show(ex.Message, "Exception!", MessageBoxButtons.OK, MessageBoxIcon.Error)
Exit Sub
End Try
' Add the file infos to the array
array.AddRange(pFileInfo)

WriteToText(array)

' Try to get the subdirectories of this one
Dim pdirInfo() As IO.DirectoryInfo
Try
pdirInfo = dirInfo.GetDirectories()
Catch ex As UnauthorizedAccessException
MessageBox.Show(ex.Message, "Exception!", MessageBoxButtons.OK, MessageBoxIcon.Error)
Exit Sub
End Try
' Iterate through each directory and recurse!
Dim dirIter As IO.DirectoryInfo

For Each dirIter In pdirInfo
hyperarray.Add(dirInfo.FullName)
RecursiveSearch(dirIter.FullName, array)
Next dirIter

End Sub

Private Sub WriteToText(ByRef array As ArrayList)

dgvFiles.DataSource = array
ListBox1.DataSource = hyperarray


End Sub

-------------------------------------------------------------------------------------------------
AnswerRe: Export folder directory listing to Excel with Hyperlinks Pin
Steven J Jowett20-Jan-10 7:08
Steven J Jowett20-Jan-10 7:08 
QuestionGetpicture method in ocx Pin
Mohamed Asane19-Jan-10 21:39
Mohamed Asane19-Jan-10 21:39 
AnswerRe: Getpicture method in ocx Pin
Estys20-Jan-10 2:14
Estys20-Jan-10 2:14 
GeneralRe: Getpicture method in ocx Pin
Mohamed Asane20-Jan-10 17:39
Mohamed Asane20-Jan-10 17:39 
GeneralRe: Getpicture method in ocx Pin
Estys21-Jan-10 2:05
Estys21-Jan-10 2:05 
QuestionVB + OleDb.OleDbCommand + MS Access issue. Pin
alexvw19-Jan-10 9:23
alexvw19-Jan-10 9:23 
AnswerRe: VB + OleDb.OleDbCommand + MS Access issue. Pin
dragon_20-Jan-10 2:38
dragon_20-Jan-10 2:38 
GeneralRe: VB + OleDb.OleDbCommand + MS Access issue. Pin
alexvw20-Jan-10 14:12
alexvw20-Jan-10 14:12 
GeneralRe: VB + OleDb.OleDbCommand + MS Access issue. Pin
dragon_20-Jan-10 18:08
dragon_20-Jan-10 18:08 
AnswerSOLVED: VB + OleDb.OleDbCommand + MS Access issue Pin
alexvw30-Jan-10 2:45
alexvw30-Jan-10 2:45 
QuestionHow to change a button background color if i know the name? Pin
spawneditions19-Jan-10 6:36
spawneditions19-Jan-10 6:36 
AnswerRe: How to change a button background color if i know the name? Pin
EliottA19-Jan-10 7:14
EliottA19-Jan-10 7:14 
GeneralRe: How to change a button background color if i know the name? Pin
spawneditions19-Jan-10 7:20
spawneditions19-Jan-10 7:20 
AnswerRe: How to change a button background color if i know the name? Pin
spawneditions19-Jan-10 8:28
spawneditions19-Jan-10 8:28 
GeneralRe: How to change a button background color if i know the name? Pin
dan!sh 19-Jan-10 18:45
professional dan!sh 19-Jan-10 18:45 
QuestionRediming An array object Containing Public Share Variant Pin
A.Najafi19-Jan-10 0:11
A.Najafi19-Jan-10 0:11 
AnswerRe: Rediming An array object Containing Public Share Variant Pin
DaveAuld19-Jan-10 5:17
professionalDaveAuld19-Jan-10 5:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.