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

x
  • 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?
0
PeterErhard
Asked:
PeterErhard
2 Solutions
 
GrahamSkanCommented:
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
 
junglerover77Commented:
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
 
PeterErhardAuthor Commented:
Thanks guys.
0

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