Quote:
Originally Posted by neilwhite
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
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.