Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-20-2020, 05:54 AM
neilwhite neilwhite is offline Batch Hyperlinking files Windows 10 Batch Hyperlinking files Office 2016
Novice
Batch Hyperlinking files
 
Join Date: Jan 2020
Posts: 6
neilwhite is on a distinguished road
Default

Paul, you are a star!


I have just 2 issues now! (tell me to go away, honestly I'll understand!)

When I run it, it includes the very top level folder that the document is saved in.
01 comes up as '01 This Folder', I should get '01 Introduction' and I get '01.01 Introduction\' instead. So then everything is then 1 level out.
It also gives me the spurious '\' at the end of that as well. That's only happening AT THE 01.01 folder level. It doesn't do it at other levels?

Finally the hyperlinks don't now work!
I get a 'security concern' pop up which I accept then I get 'an unexpected error has occurred' error. When I hover over the link it shows File:///c:\01 - Introduction - I cant see where the extra c:\ is coming from. Is that linked to the issue of being 1 level too far down the tree?
Reply With Quote
  #2  
Old 04-20-2020, 02:27 PM
macropod's Avatar
macropod macropod is offline Batch Hyperlinking files Windows 7 64bit Batch Hyperlinking files Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

Quote:
Originally Posted by neilwhite View Post
When I run it, it includes the very top level folder that the document is saved in.
01 comes up as '01 This Folder', I should get '01 Introduction' and I get '01.01 Introduction\' instead.
I had assumed you would be running the macro from a folder below your 'Introduction' folder, in which case, '01 This Folder' is technically correct, though I'd have omitted the numbering from that heading level.
Change:
.InsertAfter vbCr & "This Folder" & vbCr
to:
.InsertAfter vbCr & Split(StrFldr, "\")(UBound(Split(StrFldr, "\"))) & vbCr

Regarding the '01.01 Introduction\' issue -
Change:
.InsertAfter vbCr & strRelPath & vbCr
to:
.InsertAfter vbCr & Split(strRelPath, "\")(0) & vbCr
Quote:
Originally Posted by neilwhite View Post
Finally the hyperlinks don't now work!
I get a 'security concern' pop up which I accept then I get 'an unexpected error has occurred' error.
Does this occur with hyperlinks to Word documents, or only with hyperlinks to other file types?

If it's the latter, that's most likely because when you use Word to hyperlink to another file type, Windows recognises there's an issue, then Word's attempt to open the file fails.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Tags
batch processing, hyperlinking



Similar Threads
Thread Thread Starter Forum Replies Last Post
Batch Comparing Multiple Word Files scienceguy Word VBA 2 10-27-2021 07:43 AM
Batch Hyperlinking files Batch add suffix to PDF files in folder Dave T Windows 2 03-01-2016 08:07 PM
Remove Compatibility Mode on DOCX files (batch) w64bit Word 17 02-01-2015 06:02 AM
Batch Hyperlinking files how to batch update linked image files path? stanleyhuang Word 3 09-11-2014 12:51 AM
Hyperlinking files on a mapped network drive howler2345 Outlook 0 12-21-2011 08:54 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:09 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft