2

I am building a flowchart in MS Excel 2007. It's for a work flow. I want to be able to reference a word document which has detailed instructions about each step in the flow chart.

At each section of the flow chart, I want to create a hyperlink/button that the user can click on and open up to that specific portion (heading) of the word document. I've tried to create a shape (rectangle) and set a hyperlink to the document. That works fine, but it just opens the document at the beginning. I want the rectangle button to open at a specific heading. I am not sure if you can hyperlink this way. If not, I'm think I need to create a button control. I'm not sure if a button control can do this either.

Can anyone suggest

1) a way to hyperlink to a heading, and if not,

2) maybe a suggestion on how to use a button control to do this.

Thanks, Mike

2 Answers 2

4

There might be a way to reference BOOKMARKS you create in the word document, and then specify in your Excels Hyperlink path, the filename of the word document, plus the BOOKMARK within the file. According to this: http://office.microsoft.com/en-us/excel-help/hyperlink-function-HP010062412.aspx

it's possible. Now it's a matter of finding the way to do it using the Excel Hyperlink adding interface.

2
  • Thanks VISQL. I tried this out and it works perfectly for me.
    – Mike
    May 3, 2012 at 17:58
  • Super cool Siddharth. I've never done this before, but just used hyperlinks within an Outlook message the other day, so I wanted to figure this out too. The non-VBA way to do it is to enter something like =HYPERLINK("[C:\Users\W7User\Desktop\testytest.docx]level2", "TestyTestatLevel2") directly into the Cell.
    – VISQL
    May 3, 2012 at 18:06
3

EDIT: Beaten by VISQL :)

Yes, it is possible to do what you want. Follow these steps.

Open your word document and insert bookmarks at the relevant location. Say, we insert a bookmark called `Mike' at Heading 2.

enter image description here

Paste this code in a module in Excel.

Sub Sample()
    Dim oWordApp As Object, oWordDoc As Object, bMark As Object
    Dim FlName As String

    FlName = "C:\Sample.Docx"

    '~~> Establish an Word application object
    On Error Resume Next
    Set oWordApp = GetObject(, "Word.Application")

    If Err.Number <> 0 Then
        Set oWordApp = CreateObject("Word.Application")
    End If
    Err.Clear
    On Error GoTo 0

    oWordApp.Visible = True

    Set oWordDoc = oWordApp.Documents.Open(FlName)

    Set bMark = oWordDoc.Bookmarks("Mike")

    bMark.Select
End Sub

Right click the button and assign it to the above macro.

enter image description here

And you are done. Next time the user click on that button, the code will open the word document and will go to the relevant bookmark. Repeat the same steps for other buttons.

HTH

2
  • You sir, are awesome. That was a very quick reply and I definitely will use this! Thanks Siddharth!!
    – Mike
    May 3, 2012 at 17:57
  • + 1 Nice explanation with snapshots May 3, 2012 at 19:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.