Open word to a specific page

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • bhoff

    #1

    Open word to a specific page

    I have a program where a user can click on a LinkLabel to open a word
    document to view a reference. I can't figure out how to make word jump
    to a specified page though, example:

    A reference to test.doc, page 13 is where the user needs to find a
    reference from

    Dim wd as new microsoft.offic e.interop.word. application = new
    microsoft.offic e.interop.word. application
    Dim wdDoc as microsoft.offic e.interop.word. document

    wdDoc = wd.documents.op en(FileName)

    wdDoc.goto(13)

    All this does is open the document, but doesn't scroll down to page
    13...any Ideas?

    Thanks

  • Scott M.

    #2
    Re: Open word to a specific page

    Selection.GoTo( wdGoToPage,wdGo ToNext,"13")

    You gotta love the macro recorder.


    "bhoff" <ben_hoffman@co x.netwrote in message
    news:1161220704 .175573.244380@ h48g2000cwc.goo glegroups.com.. .
    >I have a program where a user can click on a LinkLabel to open a word
    document to view a reference. I can't figure out how to make word jump
    to a specified page though, example:
    >
    A reference to test.doc, page 13 is where the user needs to find a
    reference from
    >
    Dim wd as new microsoft.offic e.interop.word. application = new
    microsoft.offic e.interop.word. application
    Dim wdDoc as microsoft.offic e.interop.word. document
    >
    wdDoc = wd.documents.op en(FileName)
    >
    wdDoc.goto(13)
    >
    All this does is open the document, but doesn't scroll down to page
    13...any Ideas?
    >
    Thanks
    >

    Comment

    • hula

      #3
      Re: Open word to a specific page

      You gotta love the macro recorder.


      .... Thanks that helped :)

      Comment

      Working...