VB to hyperlink a filename & path

  CliffP 15:07 10 Jan 2003
Locked
  CliffP 15:07 10 Jan 2003

I need a Word 2000 macro that will insert a documents filename and path AND hyperlink it, so that I can right click, copy and paste the link into an email. Any takers ? TIA

  CliffP 16:28 10 Jan 2003

any takers?

  VoG™ 17:00 10 Jan 2003

This is Word 2002, should work in 2000

Sub Macro4()

Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"FILENAME \p ", PreserveFormatting:=True

Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend

ActiveDocument.Hyperlinks.Add Anchor:=Selection.Range, Address:= _
ActiveDocument, SubAddress:=""

End Sub

  CliffP 17:11 10 Jan 2003

Many thanks - I'll try that and let you know ...

  CliffP 13:28 14 Jan 2003

It works fine - I owe you one. Many thanks

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

The Evil Within 2 review-in-progress

InVision Studio takes on Adobe XD and Sketch

Camera tips to take better iPhone photos

Comment transformer un iPhone en borne Wi-Fi ?