Code:
Sub Spoolen()
On Error GoTo errsp
If MsgBox("Met spooling kun je facturen, betalingsherinneringen en rekening-courant-overzichten afdrukken." & vbNewLine & "Wil je dit?", 4, "Spooling") = 6 Then
GstrPad = Contact("Haal", "mmo", "SELECT * FROM H_Pointers WHERE id=1") & "\" & Format(Date, "yy-mm-dd-")
Dim fDialog As Office.FileDialog
Dim varFile As Variant
Set fDialog = Application.FileDialog(msoFileDialogFilePicker)
With fDialog
.AllowMultiSelect = True
.Filters.Clear
.Filters.Add "Selecteer de te printen bestanden of [Ctrl] + [A] voor alles", "*.pdf"
.InitialFileName = GstrPad
If .Show = True Then
For Each varFile In .SelectedItems
aa:
If InStr(varFile, "\") > 0 Then Mid(varFile, InStr(varFile, "\"), 1) = "/": GoTo aa
CreateObject("Shell.Application").NameSpace(0).ParseName(varFile).InvokeVerb ("Print")
Kill varFile
Next
Else
MsgBox "Je hebt geen bestand gekozen"
End If
End With
End If
Exit Sub
errsp:
MsgBox Error$
End Sub