uses ExtCtrls, ComObj
//
function ManageAttachments(SendersName, AttachmentPath: string;
MailDelete: Boolean): Boolean;
var
oApp: Variant;
oNs: Variant;
oFolder: Variant;
oMsg: Variant;
AtC: Variant;
AttFilename: Variant;
FileName: string;
CheckSender: string;
Counter: integer;
MailCounter: integer;
begin
try
oApp := CreateOLEObject('outlook.application');
try
oNs := oApp.GetNamespace('MAPI');
ofolder := oNS.GetDefaultFolder(6); // FolderTypeEnum (olFolderInbox)
MailCounter := 1;
// If there is any email in the Inbox
if ofolder.Items.Count > 0 then
begin
repeat
// Get the first Email
oMsg := ofolder.Items(MailCounter);
// Check the name or Email
// Use CheckSender := oMsg.subject to search on Subject;
CheckSender := oMsg.sendername;
if CheckSender = SendersName then
// Remove this line to backup all your attachments.
begin
// Check how many attachments
atc := oMsg.Attachments.Count;
if atc > 0 then
begin
// Get all the attachments and save them
for Counter := 1 to atc do
begin
AttFilename := oMsg.Attachments.item(Counter).FileName;
//filename := IncludeTrailingBackslash(AttachmentPath)+AttFilename; {Use this line for D5)}
FileName := AttachmentPath + '/' + AttFilename;
oMsg.Attachments.Item(Counter).SaveAsFile(FileName);
end;
end;
if MailDelete then
begin
oMsg.Delete;
// Theres 1 Email less, so MailCounter - 1
Dec(MailCounter);
end;
end;
// Get the next Email
Inc(MailCounter);
// Do until there is no more Email to check
until MailCounter > ofolder.Items.Count;
end;
finally
oApp.quit;
end;
except
Result := False;
Exit;
end;
Result := True;
end;
// Warning!
// All your selected Email will be deleted if MailDelete = true
procedure TForm1.Button1Click(Sender: TObject);
begin
// ManageAttachments(Email or name, Backup directory, MailDelete yes or no)
ManageAttachments('info@cleys.com', 'F:\test', False);
end;

Backup Outlook Attachments
Abonnieren
Posts (Atom)
Beliebte Posts
-
Windows Key Sniffer 0.82 - Update 08/2024 Der Windows Key Sniffer hat mir im Laufe der Zeit viel Arbeit erspart und unterstützt, viele Wi...
-
Network Source Code Update Source Code Network Update : https://asciigen.blogspot.com/p/network.html Send Message 1.0 Source Server Client ...
-
Windows Defender Bypass Version 0.75 - Update 11/2024 Den Windows 10-eigenen Virenschutz Defender kann man auf mehreren Wegen abschalt...
-
ASCii GIF Animator Update Version 0.68 (32 bit) - 11/2024 Bei dieser überarbeiteten Version ist die Kompatibilität zu den verschiedenen...
-
MD5 Hacker v.0.26 - Update 08.2024 MD5 Hashs sollten eigentlich nicht entschlüsselt werden können. Jedoch gibt es Tools, mit welchen auch ...
-
Dir Sniffer Version 0.11 - Update 02/2025 Dir Sniffer ist ein kleines aber nützliches Tool um herauszufinden, was ihr Programm auf ihrem...
-
Host Editor Version 0.65 - Update 01/2025 Hosts File Editor allows for the easy editing of host files and backup creation. Create your ...
-
Oldskool Font Generator v.0.29 - Update 11/2023 Das Tool stell 508 Bitmap Fonts zu Verfügung. Eigene Fonts können integriert werden, sie...
-
Hard Crypter 0.19 - Update 12/2023 Mit diesem Tool können Sie jede beliebige Datei auf dem Windows-System verschlüsseln. Die Byte-Erse...
Keine Kommentare:
Kommentar veröffentlichen