top of page

In the past I have posted about using vba code to automatically add hyperlinks into a Word document. The Tip of the Night for May 25, 2015 discussed how to add urls with a Visual Basic macro (to files saved on a network drive or a web address) after marking citations in the document in XE codes using the auto mark function. This code did not however work for citation references made in footnotes. The Tip of the Night for May 26, 2015 discussed a workaround using an add-in for MS Word called NoteStripper which converts footnotes to endnotes. The vba code works on the endnotes, which NoteStripper could then convert back to footnotes. However, formatting irregularities in the footnotes can prevent NoteStripper from reconverting the notes, and even when the reconversion worked, it was still necessary to carefully confirm that they were all placed back in the same spots in the document. However, the code works well in the body of a Word document, and in 2017 I posted a YouTube video describing the process.

I am now able to pass along an updated version of the vba code which will add links to both the body of a Word document and its footnotes at the same time without the need to bother with the often cumbersome process of converting the footnotes to endnotes, and reconverting them back again. Oscar Sun posted a response to my inquiry for a solution on stackoverflow.

The below visual basic code works the same way as the code discussed back in May 2015, converting urls added to XE codes to hyperlinks - but this version processes both the body and the footnotes at the same time. The steps can be followed in the below animated gif.

The key to editing the vba code is to enter the full path to the folder containing the documents you are linking to with only the first letter of that folder on the line of code beginning: If Left$(url, 4) = "

. . . change the 4 to the character count for that truncated path. So for example:

If Left$(url, 14) = "C:\foofolder\e" Then

. . . because 'C:\foofolder\e' is 14 characters long.

On the next line you want to account for how many words are used in the citations you are linking to. In this case since each citation is two words, 'Exhibit 01'; 'Exhibit 02', etc., we enter:

isHyper = 2

That's it. So long as you can generate a list of the citations in your brief or expert report and put them in a table with the corresponding PDFs you're linking to, you can automatically add 10 or 10,000 hyperlinks in your Word document.

Sub MakeHyperlinks() Dim afield As Field Dim url As String Dim isHyper As Integer Dim sr As Range For Each sr In ActiveDocument.StoryRanges 'For Each afield In ActiveDocument.Fields For Each afield In sr.Fields If afield.Type = wdFieldIndexEntry Then isHyper = 0 afield.Select Selection.Collapse url = Right$(afield.Code, Len(afield.Code) - 5) url = Left$(url, Len(url) - 2) If Left$(url, 4) = "../F" Then isHyper = 1 End If If Left$(url, 4) = "../T" Then isHyper = 2 End If If isHyper <> 0 Then Selection.MoveStart unit:=wdCharacter, Count:=-3 Selection.MoveStart unit:=wdWord, Count:=-isHyper afield.Delete ActiveDocument.Hyperlinks.Add Anchor:=Selection.Range, _ Address:=url End If End If Next afield Next sr End Sub

If you have a flash drive or disc from which you want to access a program when booting up in BIOS, the data can be saved in an .iso file - which acts as a virtual drive. The .iso image file holds the data in binary format. However you cannot download an .iso file and simply copy it to a flash drive, the standard way in Windows Explorer. To save an .iso file to a flash drive, use a free utility named Rufus, which is available here. Use the portable, or standalone version, which does not need to be installed:

[FWIW, I scanned it using Bitdefender and it was clean.] Rufus will run from the downloaded executable file and give you the option to select which flash drive you want to add an .iso image to

Rufus may take 15 minutes or more to copy an .iso file to flash drive. I used it to add the .iso file for Hiren's BootCD PE to the flash drive - it downloads from the site as a single file, 'HBCD_PE_x64.iso'. [Hiren's includes several data recovery tools, and I needed to use it to check if the drive of an old laptop I was decommissioning had been successfully wiped.].

It will take Rufus longer than an hour to add a 3 GB file to a flash drive.

When the Hiren Boot .iso file is added, you will see multiple files and folders.

I inserted the flash drive into the laptop that I wiped, and pressed F12 [the laptop was a Toshiba - other hardware may require another function key] to enter BIOS - the firmware. The flash drive was recognized:

. . . .Hiren's BootCD PE successfully ran:

5 views0 comments

Don't miss how the new TEXTJOIN formula available in MS Excel 365 is an improvement over the old CONCAT formula.

TEXTJOIN gives you the option to add delimiters in between a combined range of cells, and choose what to do when there are empty spaces in the range.

The beginning of the formula begins with the delimiter that you select:

. . . this is followed by TRUE or FALSE - TRUE stops empty spaces from being included - FALSE will add them in. Conclude the formula with the range you want to combine.

It is possible to combine multiple ranges with TEXTJOIN

=TEXTJOIN("; ",TRUE,A2:F2,A3:F3)

15 views0 comments
bottom of page