View Single Post
  #2   Report Post  
Cindy M -WordMVP-
 
Posts: n/a
Default

Hi ?B?Q2hyYXRo?=,

I want to link part of a Word document to sheet of an Excel file, that I have
inserted into the Word doc as an object. How can I create that hyperlink?
In other words, immagine you start to write an article and you stop at the
first line, by clicking on that line, you want a section of a sheet to open
with the remaining of the information you want to have. It seems there no way
to create a hyperlink between a text section of a Word Doc and an Excel sheet
located inside the Word document.

That is correct, there is not. A hyperlink assumes a separate file, saved in a
file location. The only possibility that occurs to me would be to use a
MacroButton field that activates a macro. And the macro would activate the Excel
object and navigate to the specififed location. For example

Sub HyperlinkToExcelCell()
Dim oleF As Word.OLEFormat
Dim o As Object

Set oleF = ActiveDocument.InlineShapes(1).OLEFormat
oleF.Activate
Set o = oleF.Object
o.Application.Range("Target").Select
End Sub

Where "Target" is a range in the Excel sheet that you've selected, then typed
Target in the range name box at the left of the formular bar. The above assumes
the Excel sheet is formatted in line with the text, and is the first graphical
object in the document.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)