Sub myTextToIE() Rem 選択文字列インターネット検索処理 Rem 記録者:Hitrock Camellia Shinopy Rem 言語:Outlook VBA Rem 機能:開いたアイテム内の選択した文字列を、 Rem インターネット上の検索サイトで検索する。 Rem 注記:myTextToIEを起動して使用。 Rem 第1版:2004/01/19:作成。 Rem *----*----* *----*----* *----*----* *----*----* Rem 参照設定 Microsoft Internet Controls Rem 参照設定 Microsoft HTML Object Library Rem *----*----* *----*----* *----*----* *----*----* Dim myCmmdBar As CommandBar Dim myCtrl As CommandBarButton ' CommandBarControl ' Dim i As Integer ' Dim myOlApp As Outlook.Application Dim myInspect As Inspector ' Dim myIE As InternetExplorer Dim myDoc As MSHTML.HTMLDocument Dim myURL As String ' myURL = "http://www.dion.ne.jp/mobile/mobile.html" ' DIONのPDA機器向けサイト ' Set myOlApp = GetObject(, "Outlook.Application") Set myInspect = myOlApp.ActiveInspector ' If TypeName(myInspect) = "Nothing" Then MsgBox "アイテムが作成・表示されていません。" Set myOlApp = Nothing Set myInspect = Nothing Exit Sub End If myInspect.Activate ' Set myCmmdBar = Application.ActiveInspector.CommandBars("Edit") ' 編集 Set myCtrl = myCmmdBar.FindControl(ID:=19) ' コピー myCtrl.Execute ' Set myIE = CreateObject("InternetExplorer.Application") With myIE .Navigate myURL .Visible = True Do While .Busy Loop Do Until .ReadyState = READYSTATE_COMPLETE Loop ' Set myDoc = .Document myDoc.all("kword").Select For i = 1 To 10 Rem 時間待ち Next i SendKeys "^(v)", True ' 貼り付け myDoc.all("ser").Options(0).Selected = True ' Yahoo! Rem myDoc.all("ser").Options(1).Selected = True ' infoseek myDoc.all("image").Click End With ' Set myOlApp = Nothing Set myInspect = Nothing Set myCmmdBar = Nothing Set myCtrl = Nothing Set myIE = Nothing Set myDoc = Nothing End Sub ' myTextToIE *----*----* *----*----* *----*----* *----*----*