My Assistant
![]()
Custom Search
|
![]() ![]() |
![]() |
![]() Post#1 | |
![]() Posts: 357 Joined: 20-September 12 From: Cornwall UK ![]() | Hello again folks. I'm hoping this one is straight forward. I have internet Explorer 11 open and simply need to copy the current URL from the address bar, into a field, [DiscLink], on the current form. The Microsoft Internet controls Library is loaded. Presently this is what I have, alas it does not work. CODE Private Sub btnGetURL_Click() Dim IE As SHDocVw.InternetExplorer Dim StrURL As String StrURL = IE.LocationURL Me![DiscLink] = StrURL End Sub -------------------- Live to Surf |
![]() Post#2 | |
![]() UA Admin Posts: 32,412 Joined: 20-June 02 From: Newcastle, WA ![]() | What does it mean to say it doesn't work? Wrong URL? No URL? Nothing pasted into the table or ? -------------------- My Name Is George and I believe in Karma How to Ask a Good Question Beginning SQL Server Visit My Blog on Facebook |
![]() Post#3 | |
![]() UtterAccess VIP Posts: 5,872 Joined: 30-June 11 ![]() | -------------------- Daniel Pineault (2010-2017 Microsoft MVP) Professional Help: http://www.cardaconsultants.com Free MS Access Code, Tips, Tricks and Samples: http://www.devhut.net * Design should never say "Look at me". It should always say "Look at this". -- David Craib * A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions) |
![]() Post#4 | |
![]() Posts: 357 Joined: 20-September 12 From: Cornwall UK ![]() | A fine question George. Apparently my wishing for it does not make others telepathic. Object Variable or with Block Variable not set occurs at... StrURL = IE.LocationURL This post has been edited by BuzyG: Dec 6 2017, 09:07 AM -------------------- Live to Surf |
![]() Post#5 | |
![]() UA Admin Posts: 32,412 Joined: 20-June 02 From: Newcastle, WA ![]() | Sweet. -------------------- My Name Is George and I believe in Karma How to Ask a Good Question Beginning SQL Server Visit My Blog on Facebook |
![]() Post#6 | |
![]() Posts: 357 Joined: 20-September 12 From: Cornwall UK ![]() | Thanks Daniel ![]() I just needed to bind to the current instance of IE 11. I had been trying to use the Get Object Method, which I now know doesn't work for IE. Hence why the 'Microsoft Internet Controls' Library needs to be Open. Final code was... CODE Dim SW As SHDocVw.ShellWindows Dim IE As SHDocVw.InternetExplorer Dim StrURL As String Set SW = New SHDocVw.ShellWindows For Each IE In SW If IE.NAME = "Internet Explorer" Then StrURL = IE.LocationURL Me![DiscLink] = StrURL End If Next Set SW = Nothing Set IE = Nothing -------------------- Live to Surf |
![]() Post#7 | |
![]() UtterAccess VIP Posts: 5,872 Joined: 30-June 11 ![]() | ![]() Yeah, I remember having that issue when I develop my code a while back. Ah, fun times...! -------------------- Daniel Pineault (2010-2017 Microsoft MVP) Professional Help: http://www.cardaconsultants.com Free MS Access Code, Tips, Tricks and Samples: http://www.devhut.net * Design should never say "Look at me". It should always say "Look at this". -- David Craib * A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions) |
![]()
Custom Search
|
![]() | Search Top Lo-Fi | 26th April 2018 - 07:59 PM |