Open default web browser and navigate to a page.

Core

Registered User.
Local time
Today, 12:37
Joined
May 27, 2008
Messages
79
Is there anyway to open the default web browser and navigate to a page (much like a standard hyper-link) in VBA?
 
FollowHyperlink "http://www.whatever.com"
 
FollowHyperlink "http://www.whatever.com"

Thank you.

However I am using a feature of Firefox allowing to search a text box (cannot be done via url)

so what I would enter into firefox is: ts username

however this will not work from vba, seems it needs the http://*

anyway around this?
 
That's beyond my knowledge.
 
I'm just guessing but can you put the ts username into a querystring

http://www.whatever.com?user=tsusername

eg:
Code:
Function Web_ArtistsOriginals()
    
    With CodeContextObject
        Dim WebLink As String
        WebLink = "[URL="http://www.whatever.com/?user=tsusername"][COLOR=#0066cc]http://www.whatever.com[/COLOR][/URL]" & "?user=" & .[tsusername] & ""
        Application.FollowHyperlink WebLink, , True
        HideWebToolBar
    End With
End Function

Then grab the Request.QueryString info

Simon
 
I'm just guessing but can you put the ts username into a querystring

http://www.whatever.com?user=tsusername

eg:
Code:
Function Web_ArtistsOriginals()
    
    With CodeContextObject
        Dim WebLink As String
        WebLink = "[URL="http://www.whatever.com/?user=tsusername"][COLOR=#0066cc]http://www.whatever.com[/COLOR][/URL]" & "?user=" & .[tsusername] & ""
        Application.FollowHyperlink WebLink, , True
        HideWebToolBar
    End With
End Function
Then grab the Request.QueryString info

Simon

I tried:

Code:
 FollowHyperlink "https://learning.example.co.uk/laser/tutor/findALearnerNewSearch.action?username=" & lnUsername
(Which works when you inter it into the address bar)

but when running it form the database redirects me to:

Code:
https://learning.example.co.uk/laser/invalidSession.action
Does the same when I use the link from word, even when im logged in >.<
 
You have only Identified the user now you have to take the information from the QueryString into the login

User = Request.QueryString("User")

Simon
 
I'm sorry Simon, I don't understand. the user to search for is found on the form (lnUsername)
 
I'm sorry Simon, I don't understand. the user to search for is found on the form (lnUsername)

maybe try these instead:

application.FollowHyperlink "https://learning.example.co.uk/laser/tutor/findALearnerNewSearch.action?username=" & me.lnUsername


what happens when in the browser? is it just a database search to bring up a template page? i've never seen the ".action" extension. are you sure its right?
 
maybe try these instead:

application.FollowHyperlink "https://learning.example.co.uk/laser/tutor/findALearnerNewSearch.action?username=" & me.lnUsername


what happens when in the browser? is it just a database search to bring up a template page? i've never seen the ".action" extension. are you sure its right?

That doesn't work. The code itself produces the correct URL. its just using it always goes to invalid session.

.action, I'm not sure, that the URL I see then I used the site, I didn't build the site.
 
That doesn't work. The code itself produces the correct URL. its just using it always goes to invalid session.

.action, I'm not sure, that the URL I see then I used the site, I didn't build the site.

it's possible that the site knows you are accessing the URL from code instead of clicking or typing it in. there are sites out there that can detect this.
 

Users who are viewing this thread

Back
Top Bottom