Word Document, going to page from clicking web link.

Posted on 2006-05-31
Last Modified: 2010-04-30
I'm needing to open a word document and go automatically to Page 14, from clicking on a link within a webpage.

Does anyone know of some VB Script I can use to do this from within the webpage? Or other ways of doing it?
Question by:PeterErhard
    LVL 76

    Assisted Solution

    This is tested in VB6, but I think it'll work in Script

        Dim wdApp 'As Word.Application
        Dim wdDoc 'As Word.Document
        Set wdApp = CreateObject("Word.Application")
        wdApp.Visible = True
        Set wdDoc = wdApp.Documents.Open("C:\MyFolder\MyDoc.doc")
        'wdApp.Selection.GoTo wdGoToPage, wdGoToAbsolute, 14
        wdApp.Selection.GoTo 1, 1, 14
    LVL 6

    Accepted Solution

    Copy the following code and save it as an html file, and then test it.

    <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
    <SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>

    function button1_onclick() {
          var oWord=new ActiveXObject("Word.Application");
          oWord.Selection.GoTo(1, 2, 1, 3);


    <P><INPUT type=button value=Button id=button1 name=button1 LANGUAGE=javascript onclick="return button1_onclick()"></P>


    Author Comment

    Thanks guys.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
    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.
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
    This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

    761 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

    8 Experts available now in Live!

    Get 1:1 Help Now