![]() |
|
#1
|
||||
|
||||
![]() Try the following macro: Code:
Sub HLnk2FtNt() Application.ScreenUpdating = False Dim strFolder As String, strFile As String, strDocNm As String Dim wdDoc As Document, h As Long, Rng As Range strDocNm = ActiveDocument.FullName strFolder = GetFolder If strFolder = "" Then Exit Sub strFile = Dir(strFolder & "\*.doc", vbNormal) While strFile <> "" If strFolder & "\" & strFile <> strDocNm Then Set wdDoc = Documents.Open(FileName:=strFolder & "\" & strFile, _ AddToRecentFiles:=False, Visible:=False) With wdDoc For h = .Hyperlinks.Count To 1 Step -1 With .Hyperlinks(h) Set Rng = .Range With Rng .Collapse wdCollapseEnd .Footnotes.Add Rng .End = .End + 1 End With Rng.Footnotes(1).Range.FormattedText = .Range.FormattedText .Range.Text = vbNullString End With Next .Close SaveChanges:=True End With End If strFile = Dir() Wend Set wdDoc = Nothing Application.ScreenUpdating = True End Sub Function GetFolder() As String Dim oFolder As Object GetFolder = "" Set oFolder = CreateObject("Shell.Application").BrowseForFolder(0, "Choose a folder", 0) If (Not oFolder Is Nothing) Then GetFolder = oFolder.Items.Item.Path Set oFolder = Nothing End Function
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#2
|
|||
|
|||
![]()
I receive the following error message:
Run-time error '429': ActiveX component can't create object When Debugged, it points to this line: Code:
Set oFolder = CreateObject("Shell.Application").BrowseForFolder(0, "Choose a folder", 0) |
![]() |
Tags |
hyperlink, macro, vba |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
mdhg | Word VBA | 20 | 03-06-2024 08:07 AM |
![]() |
mediadesign | Word VBA | 4 | 08-20-2018 03:20 PM |
creating manuscript w/footnotes from separate documents containing chapters with footnotes-word 2010 | Dottie | Publisher | 0 | 02-19-2017 03:18 PM |
![]() |
Atfon | Word VBA | 4 | 03-29-2016 05:51 AM |
![]() |
Jamal NUMAN | Word | 3 | 04-10-2011 02:49 PM |