1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| Private Sub cmdGoogleDeA_Click()
Call viaGoogleIti(Me!txtRue, Me!txtVille, Me!txtCP, Me!txtPays, Me!txtRue2, Me!txtVille2, Me!txtCP2, Me!txtPays2)
If Len(Me!txtDirection.Value) > 0 Then
Navigate Me!txtDirection.Value
End If
End Sub
Sub viaGoogleIti(strDireccion, strVille, strCP, strfr, strDireccion2, strVille2, strCP2, strfr2 As String)
Dim strURL As String
'Dim ie As Object 'Si on veut InternetExplorer
strDireccion = Replace(strDireccion, " ", "+") 'Convertir Espace a +
strDireccion = Replace(strDireccion, ",", "+") 'Convertir , a +
strDireccion = Replace(strDireccion, "-", "+") 'Convertir , a +
strDireccion2 = Replace(strDireccion2, " ", "+") 'Convertir Espace a +
strDireccion2 = Replace(strDireccion2, ",", "+") 'Convertir , a +
strDireccion2 = Replace(strDireccion2, "-", "+") 'Convertir , a +
strVille = Replace(strVille, " ", "+")
strVille2 = Replace(strVille2, " ", "+")
strVille = Replace(strVille, "-", "+")
strVille2 = Replace(strVille2, "-", "+")
'Il serait temps que j'adapte tout ceci à la manière de Caféïne
'http://access.developpez.com/faq/?page=ManipDATA#ReplaceChaine
strURL = "http://www.google.com/maps?"
strURL = strURL & "hl=fr&saddr=" & strDireccion & "+"
strURL = strURL & strVille & "+"
strURL = strURL & strCP
strURL = strURL & "," & strfr
strURL = strURL & "&daddr=" & strDireccion2 & "+"
strURL = strURL & strVille2 & "+"
strURL = strURL & strCP2
strURL = strURL & "," & strfr2
Me.txtDirection = strURL 'Pour passer par le Navigateur Web Microsoft
' Set ie = CreateObject("InternetExplorer.Application")
'ie.Navigate strURL
'ie.Visible = True
End Sub |
Partager