i have a problom. i want my end-user to be able by pressing a button, to get access to the recent files he got to his outlook account.
i kind of have a start but i got stuck in the end not knowing even if the beginning is good:
Code:
Private Sub GetAttachments()
Dim ns As Namespace
Dim Inbox As Outlook.MAPIFolder
Dim folder As Outlook.MAPIFolder
Dim Item As Object
Dim Atmt As Attachment
Dim FileName As String
Dim i As Integer
Set ns = GetNamespace("MAPI")
Set Inbox = ns.GetDefaultFolder(olFolderInbox)
i = 0
If Inbox.Items.Count = 0 Then
MsgBox "There are no messages in the Inbox.", vbInformation, _
"Nothing Found"
Exit Sub
End If
For Each Item In Inbox.Items
For Each Atmt In Item.Attachments
FileName = "C:\" & Atmt.FileName
Attachments.SaveAsFile FileName
i = i + 1
Next Atmt
Next Item
End Sub
thanks for your help