Thread: [Solved] Batch Hyperlinking files
View Single Post
 
Old 04-20-2020, 04:25 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,359
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Change:
strFile = Dir(strFolder & "\*.doc", vbNormal)
to:
strFile = Dir(strFolder & "\*.*", vbNormal)

After:
.InsertAfter vbCr
insert:
.Paragraphs.Last.Style = "Heading " & h + 1

Change:
Set Rng = .Hyperlinks.Add(.Characters.Last, "/../" & strRelPath & strFile, , , Split(strFile, ".doc")(0)).Range
to:
Set Rng = .Hyperlinks.Add(.Characters.Last, "/../" & strRelPath & strFile, , , strFile).Range
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote