|   |  
こんにちは。横から失礼して少し便乗してしまいます。 
 
私のところでも同様な自動暗号化zip付きのメールが来るため、少しでも手間を減ら 
すようにマクロを組んだりしていました。ものすごく中途半端なのですがご参考に共 
有したいと思います。 
 
パスワードメールのサンプルは以下のようなものです。 
 
=============== 
[宛先メールアドレス] 様 
 
暗号化したファイルを別メールで送信しましたので、 
パスワードをお知らせします。 
 
件名 : [暗号化zip付きメールの件名] 
 
パスワード : 123456789ABCDEF0 
 
よろしくお願いします。 
[以下に英文が続く] 
=============== 
 
 
暗号化zipが付いているメールを選択した状態で、下記のマクロを実行すると、パス 
ワードメール(元メールへの返信メール用のヘッダが付いている)を検索し、パス 
ワードをコピーしたうえで7zipでzipファイルを開くという動作をします。 
 
ただし、HTMLメールで画像が埋め込まれている場合にうまく動作しません。そのあた 
りは面倒になってしまい対応していません・・・。 
 
もし何かのご参考になるようでしたらご自由に改造してご使用ください。 
 
 
以下はマクロです。 
 
loaddll "tkinfo.dll"; 
 
// 秀丸メールの検索パック復元予約 
##n = dllfunc("AutoRestoreFindPack"); 
 
// 秀丸エディタの検索条件復元予約 
setcompatiblemode 0x00020000; 
 
// オリジナルメールのMessage-Idを取得(パスワードメールのIn-Reply-Toにも入っ 
ているはず) 
$$msgid = dllfuncstr("CurrentHeader", "Message-Id"); 
// Message-Idを囲っている"<>"を取り除く 
if(wcsleftstr($$msgid, 1) == "<"){ 
  $$msgid = wcsmidstr($$msgid, 1, wcslen($$msgid) - 2); 
} 
 
// 添付ファイルの個数 
##atch = dllfunc("CountCurrentHeader", "X-Attach"); 
 
// 添付ファイルパスを取得 
$$file = dllfuncstr("CurrentHeader", "X-Attach"); 
 
// HTMLメールがプレビューされているかどうか 
##html = dllfunc("IsHtmlMailViewerVisible"); 
 
// オリジナルメールのDateを取得(検索範囲を絞るため、その前後5分を検索範囲と 
する) 
$$date1 = dllfuncstr("FormatDate", dllfuncstr("ShiftDate", dllfuncstr("Curre 
ntHeader", "Date"), "-0.0.5"), "YYYY/MM/DD hh:mm"); 
$$date2 = dllfuncstr("FormatDate", dllfuncstr("ShiftDate", dllfuncstr("Curre 
ntHeader", "Date"), "+0.0.5"), "YYYY/MM/DD hh:mm"); 
 
$$subject = "[パスワードをお知らせします][Password] "; 
 
// 検索パック指定 
// 条件1      = Message-Id検索、対象ヘッダIn-Reply-To 
// 条件2      = 件名検索、大文字/小文字の区別 
// 検索範囲   = 一覧内 
// 追加の条件 = AND、添付ファイル付きじゃない、Message-Idあり、Referencesあ 
り、HTMLメールじゃない、Date指定 
##n = dllfunc("SetFindPack", "(\"" + $$msgid + "\", casesense, word, target= 
person)and(\"" + $$subject + "\", casesense, target=subject)and(\"\", target 
=smallheaderbody)and(\"\", target=smallheaderbody), flag=!attach&messageid&i 
nreplyid&!html&date=" + $$date1 + "-" + $$date2 + ", messageidtarget=inreply 
id, subfolder=0, inmail=0, hilight=0"); 
 
if(##n == 0){ 
  // 検索パック指定に失敗していたらそこで終了 
  freedll; 
  endmacro; 
} 
 
##n = dllfunc("DisableDraw", 0); 
 
// 上候補 
##n = dllfunc("FindUp"); 
##dir = 0; 
 
if(##n == 0){ 
  // 見つからなければ、下候補 
  ##n = dllfunc("FindDown"); 
  ##dir = 1; 
} 
 
if(##n == 0){ 
  // それでも見つからなければそこで終了 
  ##n = dllfunc("EnableDraw"); 
  message "パスワードメールが見つかりませんでした。マクロを終了します。"; 
  freedll; 
  endmacro; 
} 
 
// 選択されているメールの特定部分の文字列を取得してくる 
$$psw = gettext2(13, 8, 29, 8, 1); 
//message $$psw; 
// コピー 
setclipboard $$psw; 
 
// 履歴戻り を裏技実行 
//##n = sendmessage(hidemaruhandle(0),0x111,40206,0); 
 
// 履歴戻りの代わりにオリジナルメールをMessage-Idから検索しなおす 
##n = dllfunc("SetFindPack", "(\"" + $$msgid + "\", casesense, word, target= 
person)and(\"\", casesense, target=subject)and(\"\", target=smallheaderbody) 
and(\"\", target=smallheaderbody), flag=messageid&date=" + $$date1 + "-" + $ 
$date2 + ", messageidtarget=messageid, subfolder=0, inmail=0, hilight=0"); 
if(##dir == 1){ 
  ##n = dllfunc("FindUp"); 
}else{ 
  ##n = dllfunc("FindDown"); 
} 
 
// ホームディレクトリを取得(末尾は必ず\) 
$$home = dllfuncstr("HomeDir"); 
// アカウント名(フォルダ名)を取得 
$$acct = dllfuncstr("CurrentAccount"); 
 
run "C:\\Program Files\\7-Zip\\7zFM.exe \"" + $$home + $$acct + "\\" + $$fil 
e + "\""; 
 
##n = dllfunc("EnableDraw"); 
if(##html){ 
  // HTMLメールのインライン表示切替 
  ##n = sendmessage( hidemaruhandle(0), 0x111, 40336, 0); 
} 
freedll; 
endmacro; 
 
			 | 
		  
	 |