If anyone could help it would be appreciated.
We've got a word document which is an index of all the documents in the folder. It is a table with two fields. One being the document name and the other being the description of the document.
filename1.* | Description 1st table entry
filename2.* | Description 2nd table entry
filename3.* | Description 3rd table entry
etc etc
We now need to create hyperlinks for each entry in the document so the user can click on the file name and the required file will open up automatically.
The problem is there are about 1000 enteries and we don't want to have to manually create the hyperlinks for each one.
I've created a simple word macro to create the hyperlink for each line (assuming the file name is the same) but just need some way of getting the script to insert the file name into the hyperlink function as a variable. The variable needs to get copied from the first column in the document as per table at the top.
This is the macro i have created but can someone explain how i create the variable and how i get the value from the first field in the document into it.
my boss have given this to me and i don't really want to have to go back to him saying i don't know how
Thanks
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 30/01/2003 by ******** ******* Group
'
Selection.MoveRight Unit:=wdCell
Selection.MoveRight Unit:=wdCell
ActiveDocument.Hyperlinks.Add Anchor:=Selection.Range, Address:= _
"\\servername\path\filename1.*", SubAddress:="", ScreenTip:="", _
TextToDisplay:="filename1.*"
End Sub
Thanks
We've got a word document which is an index of all the documents in the folder. It is a table with two fields. One being the document name and the other being the description of the document.
filename1.* | Description 1st table entry
filename2.* | Description 2nd table entry
filename3.* | Description 3rd table entry
etc etc
We now need to create hyperlinks for each entry in the document so the user can click on the file name and the required file will open up automatically.
The problem is there are about 1000 enteries and we don't want to have to manually create the hyperlinks for each one.
I've created a simple word macro to create the hyperlink for each line (assuming the file name is the same) but just need some way of getting the script to insert the file name into the hyperlink function as a variable. The variable needs to get copied from the first column in the document as per table at the top.
This is the macro i have created but can someone explain how i create the variable and how i get the value from the first field in the document into it.
my boss have given this to me and i don't really want to have to go back to him saying i don't know how
Thanks
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 30/01/2003 by ******** ******* Group
'
Selection.MoveRight Unit:=wdCell
Selection.MoveRight Unit:=wdCell
ActiveDocument.Hyperlinks.Add Anchor:=Selection.Range, Address:= _
"\\servername\path\filename1.*", SubAddress:="", ScreenTip:="", _
TextToDisplay:="filename1.*"
End Sub
Thanks