• DİKKAT

    DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
    Altın Üyelik Hakkında Bilgi

Outlook Dosya Listesi Alma

  • Konbuyu başlatan Konbuyu başlatan askm
  • Başlangıç tarihi Başlangıç tarihi

askm

Destek Ekibi
Destek Ekibi
Katılım
4 Haziran 2005
Mesajlar
2,746
Excel Vers. ve Dili
2010-2016
Kolay gelsin.
Outlookda mevcut dosya listesini (Gelen - Giden - Sağ Klinle oluşturulan (Ali, Veli, Önemli gibi), Taslaklar vb.) alma imkanı var mıdır?
Teşekkürler.
 
Aşağıdaki kodlar ile listeyi aldım. Yalnız asıl amacım bu internette mailleri yedekleme kodları mevcut. Yedekleme yaparken örneğin Önemli klasörünün içerisine düşen Ali den gelen maili Outlook Yedekler Klasörünün altında Önemli Klasörünün altında Ali Klasörünün altına kaydetmek istiyorum. Yani makroyu çalıştırınca hangi dosya içerisinde ise bilgisayarda o adda bir klasör oluşturup onun içerisine kaydetsin istiyorum.
Bu mümkün mü?

Kod:
Public strFolders As String
 
Public Sub GetFolderNames()
    Dim olApp As Outlook.Application
    Dim olSession As Outlook.NameSpace
    Dim olStartFolder As Outlook.MAPIFolder
    Dim lCountOfFound As Long
 
    lCountOfFound = 0
      
    Set olApp = New Outlook.Application
    Set olSession = olApp.GetNamespace("MAPI")
      
     ' Allow the user to pick the folder in which to start the search.
    Set olStartFolder = olSession.PickFolder
      
     ' Check to make sure user didn't cancel PickFolder dialog.
    If Not (olStartFolder Is Nothing) Then
         ' Start the search process.
        ProcessFolder olStartFolder
    End If
     
' Create a new mail message with the folder list inserted
Set ListFolders = Application.CreateItem(olMailItem)
  ListFolders.Body = strFolders
  ListFolders.Display
      
' clear the string so you can run it on another folder
  strFolders = ""
End Sub
  
Sub ProcessFolder(CurrentFolder As Outlook.MAPIFolder)
         
    Dim i As Long
    Dim olNewFolder As Outlook.MAPIFolder
    Dim olTempFolder As Outlook.MAPIFolder
    Dim olTempFolderPath As String
     ' Loop through the items in the current folder.
    For i = CurrentFolder.Folders.Count To 1 Step -1
          
        Set olTempFolder = CurrentFolder.Folders(i)
          
        olTempFolderPath = olTempFolder.FolderPath

     ' Get the count of items in the folder
         olCount = olTempFolder.Items.Count

     'prints the folder path and name in the VB Editor's Immediate window
         Debug.Print olTempFolderPath & " " & olCount
           
        ' prints the folder name only
         ' Debug.Print olTempFolder
          
         ' create a string with the folder names.
         ' use olTempFolder if you want foldernames only
         strFolders = strFolders & vbCrLf & olTempFolderPath & " " & olCount
         
        lCountOfFound = lCountOfFound + 1
          
    Next
     ' Loop through and search each subfolder of the current folder.
    For Each olNewFolder In CurrentFolder.Folders
          
         'Don't need to process the Deleted Items folder
        If olNewFolder.Name <> "Deleted Items" Then
            ProcessFolder olNewFolder
        End If
          
    Next
      
End Sub
 
Konu günceldir.
 
Geri
Üst