UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> ActiveX web browser control    
 
   
Tygler1
post Dec 5 2005, 10:24 AM
Post#1



Posts: 537
Joined: 11-March 04
From: Pennsylvania


I am using the ActiveX web browser contol on one of my forms and it works well. What I'd like to know is there any way to add the web browser control toolbar to the browser or the form? I want the (back, forward, refresh, ect.) buttons that are on a typical IE page. Why would they beulid a web broswer and not put the controls on it in some way? Am I missing a property setting? Or do I have to put command buttons on the form and then code them in some way to make them do what I want to the web browser control (what a pain)?
Thanks
Go to the top of the page
 
schroep
post Dec 5 2005, 01:34 PM
Post#2


UtterAccess VIP
Posts: 5,202
Joined: 21-July 05
From: Denver, Colorado [USA]


I believe that there is no way to make the default toolbar/menubar/addressbar/statusbar etc. appear, even though the OCX exposes properties for them.

You have to create these functionalities yourself.

BTW, this is not a web browser that was "built"; it just exposes certain functionalities of IE and allows them to be embedded in a form. If you want a full web browser, you can always launch the real thing.
Go to the top of the page
 
schroep
post Dec 5 2005, 01:43 PM
Post#3


UtterAccess VIP
Posts: 5,202
Joined: 21-July 05
From: Denver, Colorado [USA]


This reference link may be of some help to you:
http://msdn.microsoft.com/workshop/browser.../webbrowser.asp
Go to the top of the page
 
cew657
post Dec 5 2005, 02:43 PM
Post#4



Posts: 1,078
Joined: 2-January 02
From: United States - IA


I am attaching an Access 2000 database which I use and has internet explorer features you have requested. When the database is opened, Utter Access is the default web page that opens. You can adjust this by going into the forms OnOpen event and change it to whatever you want it to.
lso, you will need to have the references set to Microsoft Internet Controls in order for this to work.
HTH
Chad
Attached File(s)
Attached File  webbrowser_example.zip ( 16.39K )Number of downloads: 360
 
Go to the top of the page
 
Tygler1
post Dec 5 2005, 02:55 PM
Post#5



Posts: 537
Joined: 11-March 04
From: Pennsylvania


Chad,
That is Exactly what I was looking for! Thank you VERY much.
Go to the top of the page
 
cew657
post Dec 5 2005, 02:58 PM
Post#6



Posts: 1,078
Joined: 2-January 02
From: United States - IA


You're welcome. Good luck with your project. thumbup.gif
had
Go to the top of the page
 
schroep
post Dec 6 2005, 07:19 PM
Post#7


UtterAccess VIP
Posts: 5,202
Joined: 21-July 05
From: Denver, Colorado [USA]


This is a nice sample. You have created a lot of the basic functionalities of the standard IE toolbar; with a little work, you could probably even emulate more of the standard IE "look".
You should consider posting this in the CODE ARCHIVE here at UA.
Go to the top of the page
 
cew657
post Dec 7 2005, 05:42 AM
Post#8



Posts: 1,078
Joined: 2-January 02
From: United States - IA


Thank you. I sure can post it in the archives especially if it will help other people. I am going to work on it a little more and see how much more functionality I can add before I put it out to the UA community.
had
Go to the top of the page
 
fallenrayne
post Dec 7 2005, 09:18 AM
Post#9



Posts: 175
Joined: 21-October 05
From: Omaha, NE


I found a way to emulate the address bar so that it will show the page that it is currently on. In the form's OnTimer event put the timer interval to 1 so it does it every 1 second. Then in the code for the timer put this in:
CODE
  
Private Sub Form_Timer()
Dim sURL As String

If sURL <> BrowserObject.LocationURL Then
sURL = BrowserObject.LocationURL
AddressBarTextBox = sURL
End If

End Sub

Pretty simple, makes it so that if sURL isn't up to date then it updates it and pushes the value to the AddressBar. Enjoy frown.gif and good luck on your project.
Go to the top of the page
 
schroep
post Dec 7 2005, 11:21 AM
Post#10


UtterAccess VIP
Posts: 5,202
Joined: 21-July 05
From: Denver, Colorado [USA]


A TimerInterval of 1 will fire every 1/1000 of a second. If you want it to fire once a second, use a TimerInterval of 1000.
think a better way to do this, though, would be to use one of the control's events, such as DOWNLOADCOMPLETE or NAVIGATECOMPLETE2, so it will just fire when needed, rather than needing to have code continuously running. For example, modifying the DOWNLOADCOMPLETE in the sample in this thread:
CODE
Public Sub webspace_DownloadComplete()
  Me!lblStatusDL.Caption = "Ready."
  Me!Text19 = webspace.LocationURL
End Sub

For (it "feels" better to me here, in terms of when the control gets updated):
CODE
Private Sub webspace_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
  Me!Text19 = webspace.LocationURL
End Sub
Go to the top of the page
 
fallenrayne
post Dec 7 2005, 11:39 AM
Post#11



Posts: 175
Joined: 21-October 05
From: Omaha, NE


Even better frown.gif I am barely learning how to code VBA and I only learn by trial and error.. I will change mine to reflect your code.. thanks for the input.
Go to the top of the page
 
schroep
post Dec 7 2005, 11:52 AM
Post#12


UtterAccess VIP
Posts: 5,202
Joined: 21-July 05
From: Denver, Colorado [USA]


If it's of any use, I've attached a ZIP file with some of the WindowsXP icons from the IE toolbar.
Attached File(s)
Attached File  IE_Icons.zip ( 16.16K )Number of downloads: 69
 
Go to the top of the page
 
cew657
post Dec 7 2005, 01:26 PM
Post#13



Posts: 1,078
Joined: 2-January 02
From: United States - IA


Cool. Thanks. I will definitely make use of them. Thanks to you and Brandon for the code example. I will use it as well. thumbup.gif
had
Go to the top of the page
 
schroep
post Dec 7 2005, 01:45 PM
Post#14


UtterAccess VIP
Posts: 5,202
Joined: 21-July 05
From: Denver, Colorado [USA]


I realized I left out the DISABLED versions for BACK and FORWARD ... the attached file has them, as well.
Attached File(s)
Attached File  IE_Icons.zip ( 18.25K )Number of downloads: 75
 
Go to the top of the page
 
jlmedeiros
post Jan 5 2006, 07:01 PM
Post#15



Posts: 2
Joined: 3-January 06



Hello, people.
thank's for the samples.
Is there a way to get a command button or else to call my favorites, in the web browser form.
I've tried to open .url files in my favorites but they open in IE and not in the web browser form.
Can you help me please.
Thanks.
Go to the top of the page
 
schroep
post Jan 5 2006, 07:23 PM
Post#16


UtterAccess VIP
Posts: 5,202
Joined: 21-July 05
From: Denver, Colorado [USA]


Welcome to UA!
How exactly are you doing this?
HE favorites is a folder on your hard drive; you could likely read through the files in that directory using Access code (for example, using the DIR function), and build a combobox or something that could send its links to the Access form. Of course, folders within your favorites folder would have to be handled. You could get all fancy and write a treeview popup form or something, if you wanted.
The general location for Favorites is:
C:\documents and settings\<username>\Favorites
but may vary depending on your setup.
Just curious as to why you want to duplicate this functionality in an Access form, though. Seems that if you need the full IE interface, it would be simpler to just launch IE. A web browser control in an Access form is just that; it doesn't become your default browser where links will be launched. It can only do what you code it to do.
Go to the top of the page
 
jlmedeiros
post Jan 9 2006, 06:11 PM
Post#17



Posts: 2
Joined: 3-January 06



thank's peter.
ok.
You're right, maybe i don't need to have all my favorites in my access form, just some of them, and for that i did'nt need help. I just thought that was easy to do it, with some control, and if it doesn't, forget it.
Thank's again.
if want to know how did i open .url files from command button, just tell me, and i send you a copy with the example code.
---------------------
João Lourenço Medeiros
Go to the top of the page
 
schroep
post Jan 9 2006, 07:08 PM
Post#18


UtterAccess VIP
Posts: 5,202
Joined: 21-July 05
From: Denver, Colorado [USA]


I know how to issue a FollowHyperlink command, I was wondering if that was how you were doing it, since you did not specify. That command uses the shell to do its executes, so it will call the default browser.
o navigate to a known URL using the ActiveX WebBrowser control, the code is:
Me!nameofwebactivexcontrol.Navigate "http://yoururlgoeshere"
THere is a function that will populate a two-column, value-list combobox with URL's from the current user's favorites folder:
CODE
Public Function fncURLList(pstrPath As String) As String
  Dim strName As String, strRetVal As String, strTemp As String, strURL As String
  Dim intFile As Integer
  strName = Dir(pstrPath, vbNormal)
  Do While strName <> ""
    intFile = FreeFile
    Open (pstrPath & "\" & strName) For Input As #intFile
    Line Input #intFile, strURL
    Line Input #intFile, strURL
    Close #intFile
    If strURL <> "" Then
      strTemp = ";" & Replace(Left(strName, Len(strName) - 4), ";", "") & ";" & Replace(Mid(strURL, 9), ";", "%3B")
      If Len(strRetVal & strTemp) <= 2048 Then strRetVal = strRetVal & strTemp ' Access 2000 can only hold 2048 characters in a ValueList combobox
    End If
    strName = Dir
  Loop
  fncURLList = Mid(strRetVal, 2)
End Function

You would call it as such (in your form's open event):
Me.cboFavorites.RowSource = fncURLList(Environ("UserProfile") & "\Favorites\")
And, of course, you would need something in the AFTERUPDATE event of that combo to set the URL:
Me!nameofwebcontrol.Navigate cboFavorites.Column(1)
Note that this is really just a demo to get you started on how to do it; it ignores any folders in the favorites directory, and, since Access 2000 has a maximum of 2048 characters that can be the source of a value-list combobox, it will stop adding favorites to the list at that point. It does demonstrate a method by which this could be done; hope it is enough to get you started.
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    18th December 2017 - 05:50 AM