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?
PeterErhardAsked:
Who is Participating?
 
junglerover77Connect With a Mentor Commented:
Copy the following code and save it as an html file, and then test it.

<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
<!--

function button1_onclick() {
      var oWord=new ActiveXObject("Word.Application");
      oWord.visible=true;
      oWord.Documents.Open("C:\\a.doc");
      oWord.Selection.GoTo(1, 2, 1, 3);
}

//-->
</SCRIPT>
</HEAD>
<BODY>

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

</BODY>
</HTML>
0
 
GrahamSkanConnect With a Mentor RetiredCommented:
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
0
 
PeterErhardAuthor Commented:
Thanks guys.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.