$destfolder = "C:\\添付ファイル";
loaddll "tkinfo.dll";
$prevaccount = dllfuncstr("CurrentAccount");
$prevfolder = dllfuncstr("CurrentFolder");
while( dllfunc( "SelectRecvMail" ) ) {
#count = dllfunc("CountCurrentHeader", "X-Attach");
if( #count > 0 ) {
#i = 0;
while( #i 'lt; #count ) {
$attach = dllfuncstr("CurrentHeader2", "X-Attach", #i);
if( dllfuncstr("ToLower", rightstr($attach,4)) == ".p7s" ) {
//スキップ
} else {
$src = dllfuncstr("HomeDir") + dllfuncstr("CurrentAccount") + "\\" + $attach;
$basename = midstr( $attach, strrstr($attach, "\\") + 1 );
$dest = $destfolder + "\\" + $basename;
#n = dllfunc("Bypass_CopyFile", $src, $dest, 0 );
#n = dllfunc("Bypass_SetFileAttributes", $dest, 0x20 );
}
#i = #i + 1;
}
}
}
#n = dllfunc("SelectFolder", $prevaccount, $prevfolder);
|