|
ということでさっそくマクロを作ってみました。マクロを実行するとメニュー
が出てきまして、そこで選択した添付ファイルが先頭に移動します。秀丸メール
本体ウィンドウ上でしか実行できないです。
loaddll "tkinfo.dll";
#count = dllfunc("CountCurrentHeader", "X-Attach");
if( #count <= 1 ) {
message "添付ファイルが1つ以下しかありません。";
endmacro;
}
#i = 0;
while( #i < #count ) {
$attach[#i] = dllfuncstr("CurrentHeader2", "X-Attach", #i);
#x = strstr( $attach[#i], "\\" );
#x = #x + 1 + strstr( midstr( $attach[#i], #x + 1, 999 ), "\\" );
$base[#i + 1] = midstr( $attach[#i], #x + 1, 999 );
#i = #i + 1;
}
$base[0] = "先頭に移動します。";
menuarray $base, #count + 1;
if( result <= 2 ) {
endmacro;
}
#target = result - 2;
#i = 0;
while( #i <= #target ) {
if( #i == 0 ) {
$new[#i] = $attach[#target];
} else {
$new[#i] = $attach[#i - 1];
}
#i = #i + 1;
}
#i = 0;
#n = dllfunc("BeginEditMail");
while( #i <= #target ) {
if( #i == 0 ) {
#new = #target;
} else {
#new = #i - 1;
}
#n = dllfunc("SetHeader2", "X-Attach", $attach[#new], #i);
#i = #i + 1;
}
#n = dllfunc("SaveEditMail", 0, 0);
|
|