follow a hyperlink from word vba autoform

Posted on 2011-04-23
Last Modified: 2012-06-21
I have a word document with many autoforms and macro code. I would like to add some code that either automatically opens a specific web page or asks the user to press a button that then goes to to the web page. How do I do this? Also, is there a way to time out if the connection isn't made?
Question by:karimjohnson
    LVL 30

    Expert Comment

    by:Paul Sauvé

    Author Comment

    indeed. I just don't know the syntax.
    LVL 30

    Accepted Solution

    This is what I normally use :)

    Private Sub Sample()
        On Error GoTo ErrIE
        Set browser = CreateObject("InternetExplorer.Application")
        browser.Visible = True
        browser.Navigate ("http://Google.Com")
        Exit Sub
        MsgBox Err.Description, vbInformation, "Oops"
    End Sub

    Open in new window


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    This is written from a 'VBA for MS Word' perspective, but I am sure it applies to most other MS Office components where VBA is used.  One thing that really bugs me is slow code, ESPECIALLY when it's mine!  In programming there are so many ways to…
    Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
    This video walks the viewer through the process of creating envelopes and labels, with multiple names and addresses. Navigate to the “Start Mail Merge” button in the Mailings tab: Follow the step-by-step process until asked to find the address doc…
    In a previous video Micro Tutorial here at Experts Exchange (, I explained how to get a free, one-month trial of Office …

    759 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

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now