![]() |
#1
|
|||
|
|||
![]() I installed the plugin for Word 2007 that lets you save as PDF. I tried it and it works okay, but it didn't preserve my endnotes. They're there, you can see them, but they don't work as hyperlinks. I looked through all the save options but didn't see anything relevant. Is it even possible in Word 2007? I tried the PDF in Foxit Reader and PDF XChange Viewer. Do I need to use a different PDF viewer or would it just be a waste of time. Appreciate any advice. ![]() |
#2
|
||||
|
||||
![]()
Hi Walt,
The PDF conversion process doesn't preserve such links. What you could do, though, is create true hyperlinks in the document between the endnotes and their references before doing the PDF conversion.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
![]()
Thank you macropod. I've already got 1619 endnotes and I'm not even half done. Is it possible to convert them all at once. I'm not gonna do them all one by one. I'll just live with it.
Thanks for confirming that Word doesn't automatically convert. At least I can quit spending any more time on that. ![]() |
#4
|
||||
|
||||
![]()
Hi Walt,
When a document is saved in PDF format, endnote & footnote references cease to act as hyperlinks. The following macro replicates the endnote & footnote references (which become hidden text) with bookmarked hyperlinks. The second macro (KillEndNoteFootNoteHyperLinks) reverses the process. Word's Note References always point to the reference in the body of the document, not to the endnote or footnote itself. Likewise, Note References don’t display the corresponding endnote/footnote text as a screen tip. The HyperlinkEndNotesFootNotes macro doesn't change that behaviour. To have the Note References hyperlink to the actual endnote or footnote – and display the corresponding endnote/footnote text as a screen tip – you could use the third macro (HLnkNoteRefs). The fourth macro (KillHLnkNoteRefs) reverses the process. Macro 1: Code:
Sub HyperlinkEndNotesFootNotes() ' Turn Off Screen Updating Application.ScreenUpdating = False Dim SBar As Boolean ' Status Bar flag Dim TrkStatus As Boolean ' Track Changes flag Dim Rng1 As Range, Rng2 As Range, i As Long ' Store current Status Bar status, then switch on SBar = Application.DisplayStatusBar Application.DisplayStatusBar = True ' Store current Track Changes status, then switch off With ActiveDocument TrkStatus = .TrackRevisions .TrackRevisions = False 'Process all endnotes For i = 1 To .Endnotes.Count 'Give the OS a chance to do any background processing DoEvents 'Update the statusbar StatusBar = "Processing Endnote " & i 'Define two ranges: one to the endnote reference the other to the endnote content Set Rng1 = .Endnotes(i).Reference Set Rng2 = .Endnotes(i).Range.Paragraphs.First.Range With Rng1 'Format the endnote reference as hidden text .Font.Hidden = True 'Insert a number before the endnote reference and bookmark it .Collapse wdCollapseStart .Text = i .Style = wdStyleEndnoteReference .Bookmarks.Add Name:="_ERef" & i, Range:=Rng1 End With 'Insert a number before the endnote content and bookmark it With Rng2 'Format the endnote reference as hidden text With .Words.First If .Characters.Last Like "[ " & vbTab & "]" Then .End = .End - 1 .Font.Hidden = True End With 'Insert a number before the endnote reference and bookmark it .Collapse wdCollapseStart .Text = i .Style = "Endnote Reference" .Bookmarks.Add Name:="_ENum" & i, Range:=Rng2 End With 'Insert hyperlinks between the endnote references .Hyperlinks.Add Anchor:=Rng1, SubAddress:="_ENum" & i, ScreenTip:=.Endnotes(i).Range.Text .Hyperlinks.Add Anchor:=Rng2, SubAddress:="_ERef" & i 'Restore the Rng1 endnote reference bookmark .Bookmarks.Add Name:="_ERef" & i, Range:=Rng1 Next 'Process all footnotes For i = 1 To .Footnotes.Count 'Give the OS a chance to do any background processing DoEvents 'Update the statusbar StatusBar = "Processing Footnote " & i 'Define two ranges: one to the footnote reference the other to the footnote content Set Rng1 = .Footnotes(i).Reference Set Rng2 = .Footnotes(i).Range.Paragraphs.First.Range With Rng1 'Format the footnote reference as hidden text .Font.Hidden = True 'Insert a number before the footnote reference and bookmark it .Collapse wdCollapseStart .Text = i .Style = "Footnote Reference" .Bookmarks.Add Name:="_FRef" & i, Range:=Rng1 End With 'Insert a number before the footnote content and bookmark it With Rng2 'Format the footnote reference as hidden text With .Words.First If .Characters.Last Like "[ " & vbTab & "]" Then .End = .End - 1 .Font.Hidden = True End With 'Insert a number before the footnote reference and bookmark it .Collapse wdCollapseStart .Text = i .Style = wdStyleFootnoteReference .Bookmarks.Add Name:="_FNum" & i, Range:=Rng2 End With 'Insert hyperlinks between the footnote references .Hyperlinks.Add Anchor:=Rng1, SubAddress:="_FNum" & i, ScreenTip:=.Footnotes(i).Range.Text .Hyperlinks.Add Anchor:=Rng2, SubAddress:="_FRef" & i 'Restore the Rng1 footnote reference bookmark .Bookmarks.Add Name:="_FRef" & i, Range:=Rng1 Next ' Restore original Track Changes status .TrackRevisions = TrkStatus 'Update the statusbar StatusBar = "Finished Processing " & .Endnotes.Count & " Endnotes" & .Footnotes.Count & " Footnotes" End With Set Rng1 = Nothing: Set Rng2 = Nothing ' Restore original Status Bar status Application.DisplayStatusBar = SBar ' Restore Screen Updating Application.ScreenUpdating = True End Sub , ScreenTip:=.Endnotes(i).Range.Text and , ScreenTip:=.Footnotes(i).Range.Text Macro 2: Code:
Sub KillEndNoteFootNoteHyperLinks() Dim SBar As Boolean ' Status Bar flag Dim TrkStatus As Boolean ' Track Changes flag Dim Rng1 As Range, Rng2 As Range, i As Long ' Store current Status Bar status, then switch on SBar = Application.DisplayStatusBar Application.DisplayStatusBar = True ' Store current Track Changes status, then switch off With ActiveDocument TrkStatus = .TrackRevisions .TrackRevisions = False End With ' Turn Off Screen Updating Application.ScreenUpdating = False With ActiveDocument 'Delete endnote/footnote hyperlinks from the MainStory For i = .Hyperlinks.Count To 1 Step -1 With .Hyperlinks(i) StatusBar = "Processing Hyperlink " & i If .SubAddress Like "_ENum*" Then .Range.Delete ElseIf .SubAddress Like "_FNum*" Then .Range.Delete End If End With Next i 'Delete endnote hyperlinks from the EndnotesStory If .Endnotes.Count > 0 Then With .StoryRanges(wdEndnotesStory) For i = .Hyperlinks.Count To 1 Step -1 StatusBar = "Processing Endnote Hyperlink " & i With .Hyperlinks(i) If .SubAddress Like "_ERef*" Then .Range.Delete End With Next i End With End If 'Delete footnote hyperlinks from the FootnotesStory If .Footnotes.Count > 0 Then With .StoryRanges(wdFootnotesStory) For i = .Hyperlinks.Count To 1 Step -1 StatusBar = "Processing Footnote Hyperlink " & i With .Hyperlinks(i) If .SubAddress Like "_FRef*" Then .Range.Delete End With Next i End With End If 'Process all endnotes For i = 1 To .Endnotes.Count 'Update the statusbar StatusBar = "Processing Endnote " & i 'Define two ranges: one to the endnote reference the other to the endnote content Set Rng1 = .Endnotes(i).Reference Set Rng2 = .Endnotes(i).Range.Paragraphs.First.Range 'Format the endnote reference as visible text Rng1.Font.Hidden = False Rng2.Words.First.Font.Hidden = False Next 'Process all footnotes For i = 1 To .Footnotes.Count 'Update the statusbar StatusBar = "Processing Footnote " & i 'Define two ranges: one to the footnote reference the other to the footnote content Set Rng1 = .Footnotes(i).Reference Set Rng2 = .Footnotes(i).Range.Paragraphs.First.Range 'Format the footnote reference as visible text Rng1.Font.Hidden = False Rng2.Words.First.Font.Hidden = False Next 'Update the statusbar StatusBar = "Finished Processing " & .Endnotes.Count & " Endnotes" & .Footnotes.Count & " Footnotes" End With Set Rng1 = Nothing: Set Rng2 = Nothing ' Restore original Status Bar status Application.DisplayStatusBar = SBar ' Restore original Track Changes status ActiveDocument.TrackRevisions = TrkStatus ' Restore Screen Updating Application.ScreenUpdating = True End Sub Code:
Sub HLnkNoteRefs() Dim Fld As Field, StrTgt As String, Rng As Range, StrRef As String, StrTxt As String For Each Fld In ActiveDocument.Fields With Fld If .Type = wdFieldNoteRef Then StrTgt = Split(Trim(.Code), " ")(1) With ActiveDocument.Bookmarks(Split(Trim(.Code), " ")(1)).Range If .Footnotes.Count = 1 Then StrTxt = .Footnotes(1).Range.Text Else StrTxt = .Endnotes(1).Range.Text End If End With Set Rng = Fld.Result.Characters.First.Previous: StrRef = Fld.Result.Text With Rng .Start = .Start + 1 .Collapse wdCollapseStart .Hyperlinks.Add Anchor:=Rng, SubAddress:=StrTgt, TextToDisplay:=StrRef, ScreenTip:=StrTxt .End = .End + 1 .Hyperlinks(1).Range.Font.Superscript = True End With .Result.Font.Hidden = True End If End With Next End Sub Call HLnkNoteRefs after the final: Next in the HyperLinkEndNoteFootNotes macro. Note:To display the footnote/endnote cross-references as hyperlinks without the screentip, simply delete: , ScreenTip:=StrTxt Macro 4: Code:
Sub KillHLnkNoteRefs() Dim Fld As Field For Each Fld In ActiveDocument.Fields With Fld If .Type = wdFieldNoteRef Then .Result.Font.Hidden = False End If End With Next End Sub Call KillHLnkNoteRefs after the final: Next in the KillEndNoteFootNoteHyperLinks macro. PS: Macros 1 & 2 reports their progress on Word's status bar.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] Last edited by macropod; 07-30-2017 at 10:03 PM. |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Changing footnotes to endnotes | Sarah | Word | 3 | 04-27-2017 08:55 PM |
![]() |
kenglade | Word | 22 | 09-14-2012 04:10 PM |
![]() |
namedujour | PowerPoint | 0 | 01-17-2012 09:42 AM |
![]() |
kenglade | Word | 4 | 12-03-2011 01:26 PM |
Index entries in endnotes | perhj | Word | 0 | 06-19-2011 09:28 AM |