?
Solved

Access VBA:  Click link for webbrowser naviation

Posted on 2010-09-17
10
Medium Priority
?
952 Views
Last Modified: 2012-05-10
I can't seem to get the syntax to work to InvokeMember click a link on a web page within the ActiveX WebBrowser object.

The WebBrowser is linking to a page that lists a series of records.  My program searches the body of the page, performs some actions, and then I want it to click the "Next" link at the bottom and start over again on the next page.  The title of the link is "Next Page".

Can you please provide syntax, including any necessary references, to click the "Next Page" link?

Thanks.
0
Comment
Question by:Phish_Head
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
  • 2
10 Comments
 
LVL 5

Expert Comment

by:rajaamirapu
ID: 33703663
Get the document from webbrower. Include html library and iterate throgh all the links. In the links you will get your link. Navigate to that link by calling the Browser.navigate
Hope this helps
0
 

Author Comment

by:Phish_Head
ID: 33704557
I'm unable to find full syntax to loop through the available links.  Can you please provide the code?
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 33705956
Another way possibly is to embed the datasheet view of a query in a form (datasheet view of a form essentially with the form's recordsource being the query). The form has properties like allowedits etc.
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
LVL 65

Expert Comment

by:rockiroads
ID: 33705958
My bad, wrong thread! doh!
0
 
LVL 65

Accepted Solution

by:
rockiroads earned 1000 total points
ID: 33706120
Ok, now I am on your thread.

From my understanding you have a webbrowser control
This has many links to it but the one you are interested in is titled Next Page
You want to find this and navigate to whatever that is?

Right assuming you had a control called webie. We get the list of links, find Next Page and navigate to that url



Dim htmldoc As HTMLDocument
    Dim htmllinks As HTMLAnchorElement
    
    Set htmldoc = webIE.Document
    For Each htmllinks In htmldoc.Links
        If htmllinks.innerText = "Next Page" Then
            webIE.Navigate2 htmllinks.href
            Exit For
        End If
    Next

Open in new window

0
 
LVL 5

Expert Comment

by:rajaamirapu
ID: 33706213
Here webIE is the webbrowser control
0
 

Author Comment

by:Phish_Head
ID: 33716377
I meant to allocate the points to rockiroads
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 33717291
I did wonder about the accepted solution until I saw your last post. You can post a question in community support to get this corrected. For PAQness sake it would be good to show the accepted solution.
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 33721964
sorry, forgot to give you the link read this when things go wrong http://www.experts-exchange.com/help.jsp#hs=29&hi=409
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question