HTMLフォームのVBAを利用した自動クリックについて。


ObjIE.Document.all.Item("sendmail").Click

でメールを送信しますが、マウスでクリックしたら無事メールが送信され、
上記プログラムでクリックしたら、また同じメール送信画面が表示されます(メール送信ボタンクリックでなく、更新ボタンを押したような動作)。

マウスクリックをプログラムで再現する必要があるのですが、
どのような代替案がありますか?

会員制サイトで再現用のHTMLを用意できなくて申し訳ないのですが、
教えて下さった可能性のある代替案を次々に試してみたいと思います。

よろしくお願い申し上げます。

回答の条件
  • 1人2回まで
  • 登録:
  • 終了:2011/01/28 08:41:33
※ 有料アンケート・ポイント付き質問機能は2023年2月28日に終了しました。

回答1件)

id:online_p No.1

回答回数1153ベストアンサー獲得回数59

ポイント60pt

フルパスで書かないとだめなんじゃないですか

id:ReoReo7

ありがとうございます。

回答者の皆様、すばらしい回答をありがとうございました。引き続きコメント欄にて進捗をかいていきます。時間がかかると思いますが気長に観察していただければ幸いです。

2011/01/28 08:41:20
  • id:ReoReo7
    <FORM name="comments" method="post"
    onsubmit="return verifyForm(null);"
    >
    とあり、verifyFormは入力データのチェックのみのようです。

    送信はどこでやっているんだろう?
  • id:Cherenkov
    ボタンのclickではなく、
    そのformに対してsubmitしてみてはどうでしょう。
  • id:ReoReo7
    >Cherenkovさん

    それが、
    ObjIE.Document.Forms("hoge").Submit
    も一緒なんですよね。

    何が解決してくれるんでしょうか?
  • id:windofjuly
    うぃんど 2011/01/24 10:11:41
    >何が解決してくれるんでしょうか?

    以下のいずれか
    (1)元のURLをさらす
    (2)ソースからURLを推測されそうな部分を自分なりに削ってさらす(削った部分によっては何度か応答を繰り返すことになるかもしれません)
    (3)formのaction要素をjavascriptなどで準備しているはずですから、その部分を自力で探して自己解決する
  • id:Cherenkov
    formとsendmail、submitボタンあたりのhtmlが知りたいですね。

    (VBAだとJScriptになるんですかね。全然わからないので)

    ObjIE.Document.all.Item("sendmail").fireEvent("onclick");
    ではどうでしょう。

    参考:
    JavaScriptの動かないコード(中級編)clickイベントを強制的に発生させたい(fireEvent/createEventの使い方) - 主に言語とシステム開発に関して
    http://d.hatena.ne.jp/language_and_engineering/20090907/p1
  • id:ReoReo7
    なるほど!それはすばらしい指針です♪

    ソースですがアドレスが

    ttps://sellercentral-japan.amazon.com/gp/help/contact/contact.html?orderID=000-0000000-0000000

    です。orderIDは固有番号です。

    ソースは下に書きます。多分個人情報はさらしてないと思いますが、残っていたら教えて下さい。
    質問解決後に削除する可能性があります。そんなのでは後に参照した人が参考にならないじゃないかと思うかもしれないのですが、問題の解決手法だけ残しておけば多少分かりにくくとも、参考にはなるんじゃないかと思っています。どうしても残せという人がいましたら教えて下さい。

    <html>
    <head>
    <link rel="stylesheet" type="text/css" href="https://images-na.ssl-images-amazon.com/images/G/01/nav2/prod/rainierCoreCSS/rainierCoreCSS-combined-coreCSS-1293.css" />


    <script type="text/javascript" src="https://images-na.ssl-images-amazon.com/images/G/09/javascripts/lib/jquery/jquery-1.4.2.min._V184876239_.js"></script>
    <script type="text/javascript" src="https://images-na.ssl-images-amazon.com/images/G/09/javascripts/lib/jquery/jquery-ui-1.8.4.custom.min._V199330974_.js"></script>
    <script type="text/javascript">
    <!--
    var gNavbarHeight = 0;
    -->
    </script>

    <script type="text/javascript">
    <!--
    window.name="rainierWindow";
    -->
    </script>
    <title>Amazon.co.jp : カスタマーに連絡</title>

    <script type="text/javascript" src="https://images-na.ssl-images-amazon.com/images/G/01/nav2/prod/rainierCoreJS/rainierCoreJS-combined-coreJS-320.js"></script>

    </head>
    <body>


    <script type="text/javascript">
    <!--
    var sc_pwm_image_width = 189;
    var sc_pwm_image_height = 102;
    -->
    </script>
    <script type="text/javascript" src="https://images-na.ssl-images-amazon.com/images/G/01/nav2/prod/rainierCoreJS/rainierCoreJS-please_wait_mask-14596._V213241101_.js"></script>

    <div id="pleasewaitmask" style="position:absolute; top:0; left:0; width:100%; background:#fff; visibility:hidden; filter:alpha(opacity=80); opacity:.8; -ms-filter:'progid:DXImageTransform.Microsoft.Alpha(Opacity=80); filter:alpha(opacity=80)'; z-index: 100;"></div>
    <div id="pleasewaitmsg" style="position: absolute; top:0; left:0; width: 189; height: 102; visibility:hidden; z-index: 101;"><img src="https://images-na.ssl-images-amazon.com/images/G/09/rainier/misc/loading-please-wait-sc._V192258473_.jpg" width="189" height="102" border="0" /></div>

    <script>
    <!--
    function setExtendedBreadcrumb(exBreadcrumb)
    {
    var normalBreadcrumb = document.getElementById("_normalBreadcrumb");
    var alternateBreadcrumb = document.getElementById("_alternateBreadcrumb");
    var extendedBreadcrumb = document.getElementById("_extendedBreadcrumb");
    if(extendedBreadcrumb && alternateBreadcrumb && normalBreadcrumb)
    {
    normalBreadcrumb.style.display = 'none';
    alternateBreadcrumb.style.display = 'block';
    extendedBreadcrumb.innerHTML = exBreadcrumb;
    }
    }

    function simpleMerchChanged( merchantID )
    {
    // show the please wait message
    showPleaseWait();

    document.location = "https://sellercentral-japan.amazon.com/gp/utilities/set-rainier-prefs.html?ie=UTF8&url=%2Fgp%2Fhomepage.html" + '&merchantID=' + merchantID;
    }


    var gNavbarHeight = 117;

    -->
    </script>
    <center><table border="0" width="99%" cellpadding="0" cellspacing="0"><tr><td>
    <link type='text/css' href='https://images-na.ssl-images-amazon.com/images/G/01/nav2/gamma/amazonJQ/amazonJQ-combined-coreCSS-8516._V231938213_.css' rel='stylesheet'>

    <script type="text/javascript">

    var amznJQ = {
    _a: [], _s: [], _d: [], _l: [], _o: [], _c: [], _cs: [],
    addLogical: function() {
    this._l.push(arguments)
    },
    addStyle: function() {
    this._s.push(arguments)
    },
    declareAvailable: function() {
    this._d.push(arguments)
    },
    available: function() {
    this._a.push(arguments)
    },
    onReady: function() {
    this._o.push(arguments)
    },
    onCompletion: function() {
    this._c.push(arguments)
    },
    completedStage: function() {
    this._cs.push(arguments)
    },

    strings: {},
    chars: {
    EOL: String.fromCharCode(0x0A),
    SQUOTE: String.fromCharCode(0x27),
    DQUOTE: String.fromCharCode(0x22),
    BACKSLASH: String.fromCharCode(0x5C),
    YEN: String.fromCharCode(0xA5)
    }
    }


    </script>

    <link href='https://images-na.ssl-images-amazon.com/images/G/01/nav2/gamma/n2CoreLibs/n2CoreLibs-combined-n2v1-32837._V264742113_.css' type='text/css' rel='stylesheet'>
    <script type='text/javascript'>

    // ======= JSF SafetyNet =======

    var goN2Initializer = {
    aHandlers: [],
    runThisWhen: function (sWhen, fFn, sComment) {
    if ((typeof fFn != 'function') || fFn == null) return false;
    this.aHandlers[this.aHandlers.length] = { sWhen: sWhen.toLowerCase(), fFn: fFn, sComment: sComment };
    return true;
    },
    isReady: function() {return false;}
    };
    function n2RunThisWhen(sWhen, fFn, sComment) { return goN2Initializer.runThisWhen(sWhen, fFn, sComment); }

    goN2Consts =
    {
    chEOL: String.fromCharCode(0x0A),
    chSQUOTE: String.fromCharCode(0x27),
    chDQUOTE: String.fromCharCode(0x22),
    chBACKSLASH: String.fromCharCode(0x5C),
    chYEN: String.fromCharCode(0xA5)
    };

    var n2sRTW1='onloadsuccess';
    var n2sRTWTBS='simplepopoverloaded';


    // ======= JSF Bootstrap (1) =======


    var goN2LibMon = {
    aLibs: {},
    aSheets: {},
    nMONITORLOAD: -1,
    lastLibraryRendered: false,
    isJSLoaded: function() { return false; },



    monitorLoad: function (sLibID, sFeature, sUrl) {
    this.aLibs[sLibID] = { sID: sLibID, nDuration: this.nMONITORLOAD, sFeature: sFeature, sUrl: sUrl };
    },

    lastMonitorLoad: function () {
    this.lastLibraryRendered = true;
    }
    }

    gsN2ImageHost='https://images-na.ssl-images-amazon.com/images/G/01/';

    // ======= JSF Bootstrap (2) =======
    var goJSFStringTableProperties = {
    less_info_36021: '情報が不足しています',
    unable_to_get_info_36020: '必要な情報を取得することができません。後でやり直してください',
    loading_13548: 'ロード中...',
    you_will_stay_here_36023: '(このページが表示されたままになります)',
    alt_text_click_to_collapse_36019: 'クリックしてこのセクションを折りたたみ、簡易表示にします',
    alt_text_click_to_expand_36018: 'クリックしてこのセクションを展開し、続きを表示します',
    no_addl_info_36017: '現時点で利用できるその他の情報はありません',
    you_will_go_to_new_page_36022: '(新しいページが表示されます)'
    };
    goJSFStringTableProperties['more-info_8559'] = '詳しくはこちら';

    var goJSFImageURLProperties = {};
    goJSFImageURLProperties['JSF-popover-border-br'] = 'https://images-na.ssl-images-amazon.com/images/G/09/gno/popover-border-br._V192264818_.gif';
    goJSFImageURLProperties['JSF-r-orange-arrow'] = 'https://images-na.ssl-images-amazon.com/images/G/09/nav2/images/arrow-r-orange-11x10._V192259641_.gif';
    goJSFImageURLProperties['JSF-popover-border-t'] = 'https://images-na.ssl-images-amazon.com/images/G/09/gno/popover-border-t._V192264781_.gif';
    goJSFImageURLProperties['JSF-thumb-no-image'] = 'https://images-na.ssl-images-amazon.com/images/G/09/x-locale/detail/thumb-no-image._V192260302_.gif';
    goJSFImageURLProperties['JSF-next-tan-sm'] = 'https://images-na.ssl-images-amazon.com/images/G/09/nav2/images/next-tan-sm._V192259611_.gif';
    goJSFImageURLProperties['JSF-popover-border-cbr'] = 'https://images-na.ssl-images-amazon.com/images/G/09/gno/popover-border-cbr._V192264819_.gif';
    goJSFImageURLProperties['JSF-next-tan-sm-dis'] = 'https://images-na.ssl-images-amazon.com/images/G/09/nav2/images/next-tan-sm-dis._V192259608_.gif';
    goJSFImageURLProperties['JSF-popover-border-l'] = 'https://images-na.ssl-images-amazon.com/images/G/09/gno/popover-border-l._V192264819_.gif';
    goJSFImageURLProperties['JSF-close-tan-sm-dn'] = 'https://images-na.ssl-images-amazon.com/images/G/09/nav2/images/close-tan-sm-dn._V192259638_.gif';
    goJSFImageURLProperties['JSF-popover-trans'] = 'https://images-na.ssl-images-amazon.com/images/G/09/gno/popover-trans._V192264783_.gif';
    goJSFImageURLProperties['JSF-d-orange-arrow'] = 'https://images-na.ssl-images-amazon.com/images/G/09/nav2/images/arrow-d-orange-11x10._V192259641_.gif';
    goJSFImageURLProperties['JSF-next-tan-sm-dn'] = 'https://images-na.ssl-images-amazon.com/images/G/09/nav2/images/next-tan-sm-dn.jpg';
    goJSFImageURLProperties['JSF-back-tan-sm'] = 'https://images-na.ssl-images-amazon.com/images/G/09/nav2/images/back-tan-sm._V192259642_.gif';
    goJSFImageURLProperties['JSF-popover-border-r'] = 'https://images-na.ssl-images-amazon.com/images/G/09/gno/popover-border-r._V192264781_.gif';
    goJSFImageURLProperties['JSF-popover-border-cbl'] = 'https://images-na.ssl-images-amazon.com/images/G/09/gno/popover-border-cbl._V192264818_.gif';
    goJSFImageURLProperties['JSF-popover-border-tr'] = 'https://images-na.ssl-images-amazon.com/images/G/09/gno/popover-border-tr._V192264818_.gif';
    goJSFImageURLProperties['JSF-loading-bar'] = 'https://images-na.ssl-images-amazon.com/images/G/09/nav2/images/loading-bar._V192259608_.gif';
    goJSFImageURLProperties['JSF-popover-border-bl'] = 'https://images-na.ssl-images-amazon.com/images/G/09/gno/popover-border-bl._V192264817_.gif';
    goJSFImageURLProperties['JSF-popover-border-tl'] = 'https://images-na.ssl-images-amazon.com/images/G/09/gno/popover-border-tl._V192264781_.gif';
    goJSFImageURLProperties['JSF-close-tan-sm'] = 'https://images-na.ssl-images-amazon.com/images/G/09/nav2/images/close-tan-sm._V192259638_.gif';
    goJSFImageURLProperties['JSF-popover-border-ctr'] = 'https://images-na.ssl-images-amazon.com/images/G/09/gno/popover-border-ctr._V192264783_.gif';
    goJSFImageURLProperties['JSF-back-tan-sm-dis'] = 'https://images-na.ssl-images-amazon.com/images/G/09/nav2/images/back-tan-sm-dis._V192259640_.gif';
    goJSFImageURLProperties['JSF-popover-border-b'] = 'https://images-na.ssl-images-amazon.com/images/G/09/gno/popover-border-b._V192264783_.gif';
    goJSFImageURLProperties['JSF-popover-border-ctl'] = 'https://images-na.ssl-images-amazon.com/images/G/09/gno/popover-border-ctl._V192264818_.gif';
    goJSFImageURLProperties['JSF-back-tan-sm-dn'] = 'https://images-na.ssl-images-amazon.com/images/G/09/nav2/images/back-tan-sm-dn.jpg';
    </script>
    <script type='text/javascript'>
    goN2LibMon.monitorLoad('utilities');
    goN2LibMon.monitorLoad('events');
    goN2LibMon.monitorLoad('simplePopover');
    goN2LibMon.monitorLoad('staticPopover');
    goN2LibMon.lastMonitorLoad();
    </script>
    <script src='https://images-na.ssl-images-amazon.com/images/G/01/nav2/gamma/n2CoreLibs/n2CoreLibs-combined-core-39582._V261300507_.js' type='text/javascript'></script>

    <!-- JSF Bootstrap (End) -->



    <!-- invisible iframe to use in submitting language change requests to retail -->
    <div style="display:none">
    <iframe id="langSwitchIframe"> </iframe>
    </div>

    <script language="Javascript">
    <!--

    function doSwitchLang(url, lang)
    {
    // submit the switch request to retail
    var switchURL = "https://www.amazon.co.jp/gp/switch-language/seller-account/sc-retail-nav-lang-switch.html?ie=UTF8&nocache=0271841975938631";
    switchURL += "&language=" + lang;
    document.getElementById('langSwitchIframe').src = switchURL;

    // reload the page
    window.location.href = url;
    }

    -->
    </script>

    <script language="JavaScript" src="https://www.amazon.co.jp/gp/seller-account/nav-only-js.html?"></script>
    <script language="JavaScript">
    jQuery(document).ready(function(){

    var switchLangLink = jQuery("#navHelpLinks a[href*=/gp/switch-language/seller-account/nav-only-js.html]");
    if ( switchLangLink.length == 1 ) {
    var href= switchLangLink.attr("href");

    var switchLang = jQuery.trim(href).match(/(?:\?|&)language=([^&]+)/)[1];

    var returnURL = window.location.href;

    returnURL = "javascript:doSwitchLang('" + returnURL + "', '" + switchLang + "')";

    switchLangLink.attr('href', returnURL);
    }
    }
    );

    </script>


    <script type='text/javascript'>
    n2RunThisWhen(
    'lastlibraryloaded',
    function() {
    // instantiate a popover object
    merchantPopUp = new N2SimplePopover();

    // register you popup feature with the events framework
    goN2Events.registerFeature('merchantAnchor',
    'merchantPopUp',
    'n2MouseOverHotspot',
    'n2MouseOutHotspot' );

    merchantPopUp.initialize('merchantAnchor', // the name for your popup DIV. any unique name will do
    'merchantPopUp', //the object crated and initialized above.
    null, //used for arrays of popovers
    null, //reserved
    'below', 0, 0); //popup goes below, left aligned.

    },
    '');

    </script>

    <div align="center" class="seamlessbreadcrumbbar"><table width="95%" border="0" cellspacing="0" cellpadding="0"><tr><td nowrap><div id="_normalBreadcrumb" style="display: block"><a href="https://sellercentral-japan.amazon.com/gp/homepage.html">出品用アカウント: 出品者 ほげ</a></div><div id="_alternateBreadcrumb" style="display: none"><a href="https://sellercentral-japan.amazon.com/gp/homepage.html">出品者 ほげ</a></div></td><td nowrap width="100%" id="_extendedBreadcrumb"></td><td nowrap align="right"><a href="https://sellercentral-japan.amazon.com/gp/communication-manager/inbox.html">メッセージ</a>&nbsp;|&nbsp;<a href="https://www.amazon.co.jp/gp/help/customer/display.html?ie=UTF8&nodeId=0000000">出品者用ヘルプページ</a>&nbsp;|&nbsp;<a href="https://www.amazon.co.jp/gp/flex/sign-out.html?ie=UTF8hogehogehoge;action=sign-out">ログアウト</a></td></tr></table></div><div
    id="showMerchantsDiv"
    style="display:none;
    border-style: solid;
    background-color: white;
    padding: 5px;">
    <div style="font-size:80%; background-color:white; padding:0">
    <table border="0" cellspacing="0" cellpadding="8" style="border:1px solid
    #183490;">

    <tr>
    <td class="tiny" align="left" nowrap="nowrap">
    <strong>出品者を変更する:</strong>
    <div style="margin-top:4px; padding-top:2px; border-top:1px dotted
    #cccccc; line-height:1.7em;">
    <a href="javascript:simpleMerchChanged( 'MERCHANTIDHOGE' )">出品者のなまえほげ</a>
    <br>
    </tr>
    </table>

    </div>
    </div>


    </td></tr></table></center>


    <script language="JavaScript">
    <!--
    jQuery(document).ready(function(){
    var comments = jQuery.trim(jQuery("#message").val());
    if (null == comments || "" == comments) {
    jQuery("#message").val("1,300文字以内でテキストを入力してください。");
    }
    });

    function verifyForm(callback) {
    if (callback == null){
    if("1,300文字以内でテキストを入力してください。" == jQuery.trim(jQuery("#message").val())) {
    return false;
    } else {
    return true;
    }
    } else {
    return callback( "1,300文字以内でテキストを入力してください。" != jQuery.trim(jQuery("#message").val()) );
    }
    }

    -->
    </script>

    <span class="small">
    <p>
    <b class="h1" style="margin-left:25px">カスタマーに連絡 &gt; ほげ ほげ</b>
    <FORM name="comments" method="post"
    onsubmit="return verifyForm(null);"
    >

    <input type="hidden" name="__mk_ja_JP" value="カタカナ" />


    <div id="composeFrame" style="width:900px; margin-left:25px; background-color:white; border-bottom: 2px solid #c9e1f4">

    <div id="composeHeader" style="background-color:#c9e1f4; padding-bottom:3px">
    <div id="headerLeftCorner" style="float:left; width:5px; height:5px;"><img src="https://images-na.ssl-images-amazon.com/images/G/09/x-locale/common/icons/eyebrow-upper-left-corner._V192261636_.gif" width="5" height="5" border="0" /></div>
    <div id="headerRightCorner" style="float:right; width:5px; height:5px;"><img src="https://images-na.ssl-images-amazon.com/images/G/09/x-locale/common/icons/eyebrow-upper-right-corner._V192261639_.gif" width="5" height="5" border="0" /></div>
    <div id="headerContent" style="margin-left:15px">
    <span class="small" style="font-weight:bold">ほげ ほげ様へのEメール</span>
    </div>

    </div><!-- END header -->

    <div id="composeBox" style="border-left:2px #c9e1f4 solid; border-right:2px #c9e1f4 solid; padding-bottom:15px">



    <div id="container" style="padding-bottom:1px">
    <div id="inner" style="float: left; overflow:hidden">

    <!-- TO/FROM box -->
    <div id="toFromBox" class="small" style="width:425px; float:left; margin-bottom:-992px; padding-bottom:1000px; padding-top:6px; padding-left:14px">

    <div style="padding-bottom:2px">
    <span style="font-weight:bold">宛先:</span>
    ほげ ほげ
    <span class="tiny">(rondom_na_mojiretsu_hoge@marketplace.amazon.co.jp)</span>
    </div>

    <div style="padding-bottom:2px">
    <span style="font-weight:bold">差出人:</span>

    出品者のなまえ
    </div>

    <div>
    <span style="font-weight:bold">件名:</span>
    <select name="subject" style="width:75%">
    <option value="-1">--- 件名の選択 ---</option>

    <option value="6">注文情報</option>

    <option value="8">評価リクエスト</option>
    <option value="9">返品</option>
    <option value="10">返金</option>
    <option value="11">その他の情報</option>

    </select>
    </div>

    </div><!-- END to/from box -->

    <!-- DETAILS box -->
    <div id="detailsBox" style="float:left;width:425px;margin-bottom:-992px;padding-bottom:1000px; padding-left:15px; padding-top:6px; border-left: 2px solid #a3a2a2">

    <div><span style="font-weight:bold">注文番号: </span>
    000-0000000-0000000<br /><li>1 <i>/</i> お金持ちになれる黄金の羽根の広い方ほげ<br /><span class="tiny"><br/></span>
    </div>

    </div><!-- END details box -->

    </div><!-- END inner -->
    </div><!-- END container -->


    <!-- Message compositon form -->
    <div id="composeInput" style="clear:both; padding:10px; border-top:2px solid #a3a2a2">

    <div class="small" style="margin-bottom:9px">

    メッセージを以下のテキストボックスに入力してください、Amazonより購入者に転送いたします。なお、メッセージにはHTMLやURLは含めないよう注意してください。Amazon.co.jpサイト上の商品を参照する場合は、商品名またはASIN/ISBNを明記してください。
    重要:この内容を送信すると、個人情報保護のため、ご登録のEメールアドレスをAmazon指定のアドレスに変換し、Amazonから送信内容を転送いたします。以下のメッセージを含め、この機能を利用した通信内容はすべてAmazon で保存します。この機能の利用にあたり、上記内容に同意するものとします。
    </div>

    <div style="margin-bottom:8px">
    メッセージ:</div>

    <div style="text-align:center">
    <textarea name="comments"

    id="message"
    onFocus="if(this.value=='1,300文字以内でテキストを入力してください。')this.value='';"
    onBlur="if(this.value=='')this.value='1,300文字以内でテキストを入力してください。';"

    style="width:75em;font-family:verdana,arial,helvetica,sans-serif;font-size:11px" rows="12"></textarea>
    </div>

    <div class="tiny" style="margin-bottom:9px">


    <br />
    なお、Amazon.co.jpでは、購入者および出品者を不正行為から保護する目的でフィルター機能を導入しています。例え不正な内容でなかったとしても、何らかの理由でフィルターを通過しなかったメッセージは、宛先に配信されませんので、あらかじめご了承ください。<br /><br />重要:このフォームは、Amazonマーケットプレイスの出品者が購入者に、商品や注文に関する内容を送信するためのものです。この目的とは無関係なメッセージを、このフォームを使用して購入者に送信することは固く禁じられています。詳しくは、<a href="https://sellercentral-japan.amazon.com/gp/help/customer/display.html?ie=UTF8&amp;nodeId=643000">Amazon.co.jp プライバシー規約</a>および<a href="https://sellercentral-japan.amazon.com/gp/help/customer/display.html?ie=UTF8&amp;nodeId=643006">マーケットプレイス参加規約</a>を参照してください。
    </div>

    </div><!-- END composeInput -->


    <div id="buttons" style="text-align:right; margin-right:10px">

    <input type="image" src="https://images-na.ssl-images-amazon.com/images/G/09/x-locale/bsms/cancel._V190445717_.gif" width="86" align="absmiddle" alt="Cancel" value="cancel" name="cancel" height="22" border="0" />


    <input type="image" src="https://images-na.ssl-images-amazon.com/images/G/09/x-locale/bsms/send-email._V190445719_.gif" width="111" align="absmiddle" alt="Send E-mail" value="email" name="sendemail" height="22" border="0" />
    </div><!-- END buttons -->
    </div><!-- END composeBox -->
    </div><!-- END composeFrame -->

    </form>


    <br style="clear:both" />

    <table align="center">




    <tr style="text-align:center;font-size:small"><td colspan="2">



    <span class="tiny"><a href="https://www.amazon.co.jp/gp/help/customer/display.html?ie=UTF8&amp;nodeId=643006">ご利用規約</a></span>


    <span class="tiny"><a href="https://www.amazon.co.jp/gp/help/customer/display.html?ie=UTF8&amp;nodeId=643000">プライバシー規約</a></span>
    &nbsp;
    &copy;2000-2009, Amazon.com, Inc. and its affiliates
    </td></tr>

    </table>



    <script type="text/javascript">
    <!--
    try { fixButtonWidths(); } catch(e) {}
    -->
    </script>

    </body>
    </html>
  • id:ReoReo7
    ObjIE.Document.all.Item("sendmail").fireEvent ("onclick")

    ではダメでした。
    うまくいったらよかったのですが・・・
  • id:Cherenkov
    フォームに "1,300文字以内でテキストを入力してください。"
    以外を入れてから試していますか?
  • id:ReoReo7
    もちろんです。
    objDOC = objIE.Document
    として

    from = objDOC.all.Item("subject").sourceIndex
    objDOC.all.Item("subject").Focus
    objDOC.all.Item(from + 6).Selected = True
    objDOC.all.Item("subject").selectedIndex = 5
    objDOC.all.Item("message").value = "めっせーじ" 
    objDOC.all.Item("sendemail").FireEvent ("onclick")
  • id:Cherenkov
    VBAさっぱりで恐縮ですけど、
    all.Itemってname属性も参照できるのですか?
    (sendmailはname属性。formにsubjectというid属性無し)


    objDOC = objIE.Document
    objDOC.sendmail.Click

    objDOC.all.comments.Submit
    にすると?
  • id:Cherenkov
    .allが抜けてました。
    objDOC.all.sendmail.Click

    参考:
    VBAでWebページに入力&ボタンクリック - Office系ソフト - 教えて!goo http://oshiete.goo.ne.jp/qa/2097240.html
  • id:a-kuma3
    送信ボタンは、以下の element だと思いますが、
    <input type="image" src="https://images-na.ssl-images-amazon.com/images/G/09/x-locale/bsms/send-email._V190445719_.gif" width="111" align="absmiddle" alt="Send E-mail" value="email" name="sendemail" height="22" border="0" />
    name が、sendemail になってます。
    質問では、sendmail となってて、d の後の "e" が抜けてますが、それがうまくいかない原因なんぢゃ?
  • id:ReoReo7
    >Cherenkovさん

    >all.Itemってname属性も参照できるのですか?
    はい、問題なく出来ていると思います。

    >objDOC.sendemail.Click
    >objDOC.all.comments.Submit
    >にすると?
    これもダメですね。。。提案ありがとうございます。
  • id:ReoReo7
    >a-kuma3さん

    ご指摘の通りです。
    正しくは
    objDOC.all.Item("sendemail").Click
    です。

    誤解を与えてすみませんでした。質問文に書き写す際に、ミスをしたようで、
    実際には上記の通りの動作でもうまくいきません。(ちなみに、名前をミスするとerrorを発生し、特定の場所に移動するようになっています。)
  • id:Cherenkov
    http://ken3-info.blog.ocn.ne.jp/objie/2009/05/qa_0502_submit_.html
    これと似てる。
  • id:a-kuma3
    fireEvent("onmousedown") でも、駄目でしょうか?
  • id:ReoReo7
    >Cherenkovさん
    .Click
    .Submit
    ともダメですねー

    あとSendkeysでTabでフォーカスを移す、あるいは
    .Focus
    でフォーカスをボタン上に移して、SpaceあるいはEnterで実行しても同じくダメですね(画面更新のような動作)。

    自動送信メールを巧妙に阻止しているような・・・
    一体何がトリガーになっているのでしょう?
  • id:ReoReo7
    >a-kuma3さん

    fireEvent("onmousedown")
    おっと思い、試してみましたが、ダメですね。。
    fireEvent
    系は、反応無しです。
  • id:ken3memo
    これ、アマゾンですよね。
    画像ボタン input type=image になっていて、
    http://ken3-info.blog.ocn.ne.jp/test/2007/02/_input_type_ima_3f58.html
    ↑昔のテスト..解決してないけど(ぉぃぉぃ)

    マウスで、押した場所、x,yがわたるようになっていて、
    0,0
    速い話が、マウスで押していないと はじく 古典的なアマゾンのロボットよけ だったような・・・

    詳しくアップしたソースを見ていないのですが、
    サーバー側で x=0,y=0 とかポジションチェックしていると、.Clickだとまずいかなぁ。

    解決した人は、POSTのデータを自分で作って送ったらOKだったと聞いたのですが、
    ソースを送ってくれなくて、私も未解決の事例だったり。

    もしかしてのはなしなので、的外れ、脱線させてしまったらすみません。
  • id:ReoReo7
    なるほど、ken3memoさんの
    ユーザーフォームの送信データの記録みたいなものを使えば
    可能かもしれないということでしょうか?

    確か、beforenavigate的なもののパラメータとかを変えたりしていましたよね!
  • id:ken3memo
    あっ、なるほど。
    自分で全てのパラメータ組むとエンコードとか大変だから、
    送信前のPostDataを抜いて、
    x=0 y=0 を x=10 y=10 に置き換えて、再度おくるといいのかも。
    ※↑試していない、思いつきなので、そんなこと可能かわかりませんが、チャレンジして結果を教えていただけると、みなさんのためになると思います。(と、逃げたな(ぉぃぉぃ))

    テストで、POSTDATAを覗き見して、手作業のデータと自動Clickで違いをみてからチャレンジしてくださいね。
  • id:ReoReo7
    分かりました、やってみます。
    次のまとまった作業時間が取れるのが数日後になると思いますので、その後報告します。
  • id:ReoReo7
    遅くなりましたが、ken3memoさんのブログを参考に実行したところ、POSTDATA送信にて解決しました。また、ご指摘の通り、x=0 y=0 を x=10 y=10 に置き換えたらできました。ありがとうございました。

この質問への反応(ブックマークコメント)

「あの人に答えてほしい」「この質問はあの人が答えられそう」というときに、回答リクエストを送ってみてましょう。

これ以上回答リクエストを送信することはできません。制限について

回答リクエストを送信したユーザーはいません