Quantcast
Channel: OKWAVE 最新質問([技術者向] コンピューター/205)【本日】
Viewing all articles
Browse latest Browse all 38062

タグ<type=file>にファイル名を指定したい

$
0
0
VBAでファイルをアップロードしたいのですが、 テキストボックスにファイル名を入れる事ができません。 http://oshiete.goo.ne.jp/qa/4624451.htmlを参考に、 ------------------------------------------------------- <html> <head> <title>タイトル</title> </head> <body> <FORM encType=multipart/form-data method=post action=/filemanager/upload><INPUT name=directory value=Sample type=hidden> <INPUT name=userfile size=40 type=file> </body> </html> ------------------------------------------------------- というソースに対して、 ------------------------------------------------------- Sub テスト() Dim objIE As InternetExplorer Set objIE = CreateObject("InternetExplorer.Application") objIE.Visible = True objIE.Navigate "C:\Users\○○\Desktop\test.html" Application.wait (Now + TimeValue("00:00:03")) objIE.Document.all.Item("userfile").Click 'ダイアログが開く Application.SendKeys "C:\Users\○○\Desktop\aetaw.html", True '何もされない End Sub ------------------------------------------------------- をしたのですが、SendKeysの行が機能しません。 ------------------------------------------------------- Sub テスト() Dim objIE As InternetExplorer Set objIE = CreateObject("InternetExplorer.Application") objIE.Visible = True objIE.Navigate "C:\Users\○○\Desktop\test.html" Application.wait (Now + TimeValue("00:00:03")) objIE.Document.all("userfile").Value = "test" End Sub ------------------------------------------------------- は、エラーにはならないけど値も入らなかったです。 何か解決策はありますでしょうか?ご回答よろしくお願いします。

Viewing all articles
Browse latest Browse all 38062

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>