Thema Datum  Von Nutzer Rating
Antwort
Rot PDF Anhang in Mail bestimmter Absender auto. Druck
14.12.2010 16:45:08 Stefan76
NotSolved
14.12.2010 19:28:33 Severus
NotSolved
14.12.2010 19:29:50 Severus
NotSolved
15.12.2010 08:18:16 Stefan76
NotSolved
15.12.2010 13:16:57 Severus
NotSolved
23.12.2010 15:50:49 Stefan76
NotSolved
23.12.2010 15:52:00 Stefan76
NotSolved
23.12.2010 17:24:38 Severus
NotSolved
10.02.2011 14:30:07 Stefan76
NotSolved
10.02.2011 15:07:41 Severus
NotSolved

Ansicht des Beitrags:
Von:
Stefan76
Datum:
14.12.2010 16:45:08
Views:
3188
Rating: Antwort:
  Ja
Thema:
PDF Anhang in Mail bestimmter Absender auto. Druck
Hallo Leute,

aktuell lasse ich in Outlook 2003 per VBA alle PDF Anhänge in neuen Mails
automatisch Drucken. Ist es möglich nur PDF Anhänge von bestimmten Absendern wie z.b. *@123.de drucken zu lassen??
Hier mein bisheriger Code der unter ThisOutlookSession steht:

Private Declare Function ShellExecute Lib "shell32.dll" Alias _
"ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Private WithEvents Items As Outlook.Items

Private Sub Application_Startup()
Dim Ns As Outlook.NameSpace
Dim Folder As Outlook.MAPIFolder

Set Ns = Application.GetNamespace("MAPI")
Set Folder = Ns.GetDefaultFolder(olFolderInbox)
Set Items = Folder.Items
End Sub

Private Sub Items_ItemAdd(ByVal Item As Object)

If TypeOf Item Is Outlook.MailItem Then
PrintAttachments Item
End If
End Sub

Private Sub PrintAttachments(oMail As Outlook.MailItem)
On Error Resume Next
Dim colAtts As Outlook.Attachments
Dim oAtt As Outlook.Attachment
Dim sFile As String
Dim sDirectory As String
Dim sFileType As String
sDirectory = "D:\Attachments\"
Set colAtts = oMail.Attachments
If colAtts.Count Then
For Each oAtt In colAtts
sFileType = LCase$(Right$(oAtt.FileName, 4))
Select Case sFileType
Case ".pdf"
sFile = ATTACHMENT_DIRECTORY & oAtt.FileName
oAtt.SaveAsFile sFile
ShellExecute 0, "print", sFile, vbNullString, vbNullString, 0
End Select
Next
End If
End Sub

Ich hoffe mir kann hier jemand helfen.
Schon mal Danke!!!!

Ihre Antwort
  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen
Thema: Name: Email:



  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen

Thema Datum  Von Nutzer Rating
Antwort
Rot PDF Anhang in Mail bestimmter Absender auto. Druck
14.12.2010 16:45:08 Stefan76
NotSolved
14.12.2010 19:28:33 Severus
NotSolved
14.12.2010 19:29:50 Severus
NotSolved
15.12.2010 08:18:16 Stefan76
NotSolved
15.12.2010 13:16:57 Severus
NotSolved
23.12.2010 15:50:49 Stefan76
NotSolved
23.12.2010 15:52:00 Stefan76
NotSolved
23.12.2010 17:24:38 Severus
NotSolved
10.02.2011 14:30:07 Stefan76
NotSolved
10.02.2011 15:07:41 Severus
NotSolved