Hello guys,I have this code which serves to copy the information of the mails of the folders and subfolders that I have selected.But what I want is that in line 1 only the name of the second folder comes out. What happens is that I have the main folder that is "Advisors" and inside that folder is the sub folder with the name of each advisor, inside those subfolders are folders with categorized emails.
Picked folder\Second folder(What i need)\ other sub folder\etc...
I need your help.Sorry for the bad english
Public xlSht As Excel.Worksheet
Sub DocumentFolders(objParent As folder, lRow As Long)
Dim objItm As Object
Dim objFolder As folder
On Error Resume Next
With xlSht
For Each objItm In objParent.Items
.Cells(lRow, 1) = objParent
.Cells(lRow, 2) = objItm.SenderEmailAddress
.Cells(lRow, 3) = objItm.Subject
.Cells(lRow, 4) = objItm.ReceivedTime
.Cells(lRow, 5) = objItm.Categories
lRow = lRow + 1
Next
End With
On Error GoTo 0
If objParent.folders.Count > 0 Then
For Each objFolder In objParent.folders
Call DocumentFolders(objFolder, lRow)
Next
End If
End Sub
Sub Exportar_datos()
Dim xlApp As Excel.Application
Dim xlWb As Excel.Workbook
Dim folder
Set xlApp = New Excel.Application
Set xlWb = xlApp.Workbooks.Add
Set xlSht = xlWb.Sheets(1)
With xlSht
.Cells(1, 1) = "Carpeta"
.Cells(1, 2) = "Correo"
.Cells(1, 3) = "Asunto"
.Cells(1, 4) = "Hora"
.Cells(1, 5) = "Categoría"
End With
Call DocumentFolders(Session.PickFolder(), 2)
xlApp.Visible = True
Set xlSht = Nothing
Set xlWb = Nothing
Set xlApp = Nothing
End Sub
****** id="cke_pastebin" style="position: absolute; top: 8px; width: 1px; height: 1px; overflow: hidden; left: -1000px;">Hello boys,I have this code which serves to copy the information of the mails of the folders and subfolders that I have.But what I want is that in line 1 only the name of the second folder comes out. What happens is that I have the main folder that is "Advisors" and inside that folder is the sub folder with the name of each advisor, inside those subfolders are folders with categorized emails.I need your help.Sorry for the bad english</body>
Picked folder\Second folder(What i need)\ other sub folder\etc...
I need your help.Sorry for the bad english
Public xlSht As Excel.Worksheet
Sub DocumentFolders(objParent As folder, lRow As Long)
Dim objItm As Object
Dim objFolder As folder
On Error Resume Next
With xlSht
For Each objItm In objParent.Items
.Cells(lRow, 1) = objParent
.Cells(lRow, 2) = objItm.SenderEmailAddress
.Cells(lRow, 3) = objItm.Subject
.Cells(lRow, 4) = objItm.ReceivedTime
.Cells(lRow, 5) = objItm.Categories
lRow = lRow + 1
Next
End With
On Error GoTo 0
If objParent.folders.Count > 0 Then
For Each objFolder In objParent.folders
Call DocumentFolders(objFolder, lRow)
Next
End If
End Sub
Sub Exportar_datos()
Dim xlApp As Excel.Application
Dim xlWb As Excel.Workbook
Dim folder
Set xlApp = New Excel.Application
Set xlWb = xlApp.Workbooks.Add
Set xlSht = xlWb.Sheets(1)
With xlSht
.Cells(1, 1) = "Carpeta"
.Cells(1, 2) = "Correo"
.Cells(1, 3) = "Asunto"
.Cells(1, 4) = "Hora"
.Cells(1, 5) = "Categoría"
End With
Call DocumentFolders(Session.PickFolder(), 2)
xlApp.Visible = True
Set xlSht = Nothing
Set xlWb = Nothing
Set xlApp = Nothing
End Sub
****** id="cke_pastebin" style="position: absolute; top: 8px; width: 1px; height: 1px; overflow: hidden; left: -1000px;">Hello boys,I have this code which serves to copy the information of the mails of the folders and subfolders that I have.But what I want is that in line 1 only the name of the second folder comes out. What happens is that I have the main folder that is "Advisors" and inside that folder is the sub folder with the name of each advisor, inside those subfolders are folders with categorized emails.I need your help.Sorry for the bad english</body>