Bekijk de onderstaande video om te zien hoe je onze site als een web app op je startscherm installeert.
Opmerking: Deze functie is mogelijk niet beschikbaar in sommige browsers.
Je hebt denk ik mazzel, want het bestand dat ik nodig heb vond ik nog in mijn Verzonden Items. Ik ben de code nu aan het bekijken.
:d:d en toen :mazzel
:d:dIk ben de code nu aan het bekijken
Function MailInlezen()
' Variabelen declareren
Dim FileName As String, FileImport As String, tmpFileImport As String, Pad As String, tmpFile As String
Dim i As Integer, iCount As Integer, iTus As Integer, iToe As Integer
Dim arr As Variant
' Outlook Variabelen declareren Early Binding
Dim olApp As Outlook.Application
Dim olNs As Outlook.Namespace
Dim Folder As Outlook.Folder
Dim Item As Outlook.MailItem
Dim Atmt As Outlook.Attachment
Dim cnt As String
' Outlook Variabelen declareren Late Binding
''Dim olApp As Object
''Dim olNs As Object
''Dim Folder As Object
''Dim Item As Object
''Dim Atmt As Object
On Error GoTo SaveAttachmentsToFolder_err
'-------------------------------------------------------------------------------------------
'Pad voor bestanden: C:\Test\Jaartal. Map wordt aangemaakt als hij niet bestaat.
'-------------------------------------------------------------------------------------------
Pad = "C:\Test\" & Format(Date, "yyyy") & "\"
On Error GoTo DirMaken
ChangeFolder:
ChDir (Pad)
Set DestWB = Workbooks(WerkBoek)
Set Overzicht = DestWB.Sheets(WerkBlad)
'-------------------------------------------------------------------------------------------
'Met Early binding een Outlook sessie openen.
'-------------------------------------------------------------------------------------------
Set olApp = New Outlook.Application
'-------------------------------------------------------------------------------------------
'Met Late binding een Outlook sessie openen.
'-------------------------------------------------------------------------------------------
''On Error Resume Next
''Set olApp = GetObject(, "Outlook.Application")
''If Err.Number = 429 Then
'' Set olApp = CreateObject("Outlook.Application")
''End If
On Error GoTo 0
'-------------------------------------------------------------------------------------------
' De variabele Folder instellen op de standaard postbus
'-------------------------------------------------------------------------------------------
Set olNs = olApp.GetNamespace("MAPI")
Set Folder = olNs.GetDefaultFolder(6) ' Met Late Binding
Set Folder = NS.GetDefaultFolder(olFolderInbox) ' Met Early Binding
' Of typ een naam voor het selecteren van een vaste folder...
Set Folder = olNs.GetDefaultFolder(olFolderInbox).Folders("Sollicitaties")
' Gebruik onderstaande routine om een folder te selecteren...
Set Folder = olNs.PickFolder
Set Folder = Application.GetNamespace("MAPI").PickFolder
'-------------------------------------------------------------------------------------------
' Controleer de Folder op mails en sluit af als er niets gevonden wordt.
'-------------------------------------------------------------------------------------------
i = 0
If Folder.items.Count = 0 Then
MsgBox "Er zijn geen sollicitaties in de folder " _
& Folder.Name & " gevonden.", vbInformation, "Niets gevonden"
Exit Function
End If
'-----------------------------------------------------------------------------------------
' Mail uitlezen en in een Array zetten.
'-----------------------------------------------------------------------------------------
iCount = Folder.items.Count
i = iCount - 1
For Each Item In Folder.items
iTus = 0: iToe = 0
cont = Split(Item.Body, vbCrLf)
cnt = Item.Body
arr = cont
myArray = Overzicht.UsedRange
With Overzicht
.Activate
LastRow = .Cells(.Rows.Count, "B").End(xlUp).Row
End With
Cells(LastRow, 1).Select
End Function
We gebruiken essentiële cookies om deze site te laten werken, en optionele cookies om de ervaring te verbeteren.