Advertisement
Advertisement
| 07.16.2008 at 10:57AM PDT, ID: 23570636 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: |
Sub Sample()
Dim outApp As New Outlook.Application
Dim outNS As Outlook.NameSpace
Dim outFdr As Outlook.MAPIFolder
Set outNS = outApp.GetNamespace("MAPI")
For Each outFdr In outNS.Folders
OMF2 outFdr
Next outFdr
End Sub
Function OMF2(F As Outlook.MAPIFolder, Optional lngLayer As Long = 0)
Dim lng As Long
'Debug.Print Space(lngLayer * 3) & f.Name
CurrentDb.Execute "Insert Into tOLK_Folders(Folder,Class,CurrentView,Description,FolderPath) Values('" & F.Name & "', '" & CStr(F.Class) & "', '" & CStr(F.CurrentView) & "', '" & F.Description & "', '" & F.FolderPath & "')"
For lng = 1 To F.Folders.Count
OMF2 F.Folders(lng), lngLayer + 1
Next lng
End Function
|