Option Compare Database
Option Explicit
Const BaseUrl = "http://maps.google.co.jp/maps?hl=ja&dirflg=d&"
Private Sub Form_Open(Cancel As Integer)
Me.NavigationButtons = False
Me.RecordSelectors = False
End Sub
Private Sub cmdAdd_Click()
If Not Me.txtAddress = "" Then
Me.list01.AddItem Me.txtAddress
Me.txtAddress = ""
End If
End Sub
Private Sub cmdDel_Click()
If Me.list01.ListCount > 0 And Not Me.list01.ListIndex = -1 Then
Me.list01.RemoveItem Me.list01.ListIndex
End If
End Sub
Private Sub cmdGoogleMap_Click()
If Me.list01.ListCount > 0 Then
Me.WebBrowser01.ControlSource = URLstring("about:blank")
Me.WebBrowser01.ControlSource = URLstring(BaseUrl & QString)
End If
End Sub
Private Sub WebBrowser01_BeforeNavigate2(ByVal pDisp As Object, URL As Variant, flags As Variant, TargetFrameName As Variant, PostData As Variant, Headers As Variant, Cancel As Boolean)
Me.imgBusy.Visible = True
End Sub
Private Sub WebBrowser01_DocumentComplete(ByVal pDisp As Object, URL As Variant)
Me.imgBusy.Visible = False
End Sub
Private Function URLstring(x As String)
URLstring = Chr(61) & Chr(34) & x & Chr(34)
End Function
Private Function QString() As String
QString = "q=" & UrlEncodeUtf8("from:" & Replace(Me.list01.RowSource, ";", " to:"))
End Function
From: to: で繋いだクエリを投げるとグーグル先生がうまいこと処理してくれるからこれでいい。
で、途中気づいたこと。
Webブラウザコントロールの実態はIEなのだけど、Flash要と出たところからすると、64bitIEが動作している。
現在の環境は、Win7x64+Office2010x64
2 件のコメント:
超初心者です。
access2010のwebbrowserコントロール(標準装備になったやつ)でウエッブページの再読み込みしようとして、いろいろ試しているのですが、出来ないまま2日目なんです。(泣)
何かヒントいただけないでしょうか?
よろしくお願いします。
基本的に自分用落書きのつもりで投稿しているからコメントを全くチェックしてなかった。
一週間も放置していて正直申し訳ない。
後程記事に追加しておきますから勘弁してね。
コメントを投稿