[Last Call] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 177
  • Last Modified:

Word Document, going to page from clicking web link.

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?
2 Solutions
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
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>

PeterErhardAuthor Commented:
Thanks guys.

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now