WSH/JScriptã§ï¼Outlookãæä½ããããï¼åä¿¡ã¡ã¼ã«å ããURLãæ½åºãã¦ã¿ãï¼
WSHã®ãããã§Outlookã«ã¢ã¯ã»ã¹ãï¼ã¡ã¼ã©ã¼ä¸ã®å®åä½æ¥ãæ¸ã¾ããã
ãã®ããã®ï¼"Outlook.Application"ã¨ããAPIã®ä½¿ãæ¹ã®ãµã³ãã«ã³ã¼ãã
ãµã³ãã«ã³ã¼ã
以ä¸ã open_url.js ã¨ãã§ä¿åãï¼ããã«ã¯ãªãã¯ã
// Outlookã®ææ°ã®åä¿¡ã¡ã¼ã«å ã«è¨è¼ããã¦ããURLãIEã§éã // // åèï¼ // http://homepage3.nifty.com/aya_js/office2k/index.htm // æ°è¦outlookãèµ·å var outlook = WScript.CreateObject("Outlook.Application"); // åä¿¡ãã¬ã¤ãéã var olFolderInbox = 6; // åä¿¡ãã¬ã¤ã表ãå®æ° var name_space = outlook.GetNamespace("MAPI"); var folder = name_space.GetDefaultFolder( olFolderInbox ); folder.Display(); // http://www.ken3.org/guchi/backno/guchi022.html // ã¡ã¼ã«ã®åè¨ä»¶æ°ã表示 //WScript.Echo( folder.Items.Count ); // 1件ç®ã®ã¡ã¼ã«ï¼ï¼æãå¤ãã¡ã¼ã«ï¼ã®æ¬æã表示 //WScript.Echo( folder.Items(1).Body ); // ææ°ã®ã¡ã¼ã«ã®æ¬æãHTMLã½ã¼ã¹å½¢å¼ã§åå¾ var src = folder.Items( folder.Items.Count ).HTMLBody; //WScript.Echo( src ); // Outlook VBAã§ããã°ï¼ActiveInspector.CurrentItem㧠// ç¾å¨è¡¨ç¤ºä¸ã®ã¡ã¼ã«ã¢ã¤ãã ã«ã¢ã¯ã»ã¹ã§ãã // http://www.atmarkit.co.jp/bbs/phpBB/viewtopic.php?topic=23826&forum=8&start=8 // æ¬æããURLãæ½åº var match_results = src.match( /<a href="(http:.+)">/i ); if( match_results != null ) { var link = match_results[1]; // gãªãã·ã§ã³ç¡ãã®String.matchã¯ï¼ // æçµãããæååå ¨ä½ã¨ï¼ãã£ããã£æååãã¡ã®é åãè¿ãã // http://d.hatena.ne.jp/chalcedony_htn/20090315/1237121111 //WScript.Echo( link ); // ãã®ãªã³ã¯ãIEã§éã var ie = WScript.CreateObject("InternetExplorer.Application"); ie.Navigate( link ); ie.Visible = true; } else { WScript.Echo( "URLãè¨è¼ããã¦ãã¾ããã" ); } // Outlookã®ææ°ã®ã¦ã£ã³ãã¦ãéãã¦çµäºãã outlook.explorers.Item( outlook.explorers.Count ).Close(); // <EXCEL/VBA> OUTLOOKã®ã¦ã¤ã³ããéããæ¹æ³ // http://oshiete1.watch.impress.co.jp/qa5722929.html // outlookã®å ¨ã¦ã£ã³ãã¦ãçµäºãããå ´å //outlook.Quit();
ã³ã¼ãã®è§£èª¬
ç´°ããªè§£èª¬ã¯ã³ã¼ãä¸ã®URLãåç §ã
Outlookã¯ã¡ã¼ã«ã½ããã¨ãã¦ã¯ã¨ã«ããéãï¼ã¨ããç¹ãä¸è©ã
ãããéãã ããã£ã¦ï¼ä»ã®MS製åã¨åããå å®ããAPIãæä¾ããã¦ããã
ãã詳ããæ å ±ãå¾ããå ´åï¼
- Outlook VBA
- Outlook ã¢ãã¤ã³
ãªã©ã®ãã¼ã¯ã¼ãã追ããããäºã«ãªãã ããã
ã