Sub BibleGatewayFetchPlus() ' Paul Beverley - Version 29.08.26 ' Launches Bible references on BibleGateway ' Add this line to the very top of your VBA area, ' but without the apostrophe! ' Private pbGatewayPlus As String mySite = "https://www.biblegateway.com/passage/?search=" myVersion = "NKJV" myVersion = "NIV" gottaRef = False myCh = Left(Selection, 1) If LCase(myChar) = UCase(myChar) Then Do While ((Asc(Selection) < 65 And _ Asc(Selection) > 44)) Or Left(Selection, 1) _ = ChrW(8211) Selection.MoveStart , -1 DoEvents Loop Selection.MoveStart , 1 Do While (Asc(Right(Selection, 1)) < 65 And _ Asc(Right(Selection, 1)) > 45) Or Right(Selection, 1) _ = ChrW(8211) Selection.MoveEnd , 1 DoEvents Loop Selection.MoveEnd , -1 If Len(Selection) > 2 Then gottaRef = True If pbGatewayPlus = "" Then myNewBook = InputBox("Enter book name:", "BibleGatewayFetchPlus", myBook) pbGatewayPlus = myNewBook End If mySubject = pbGatewayPlus & " " & Selection End If End If If gottaRef = False Then If Selection.Start = Selection.End Then Selection.Expand wdWord Do While InStr(ChrW(8217) & "'", Right(Selection.Text, 1)) > 0 Selection.MoveEnd , -1 DoEvents Loop Selection.MoveStart , -2 If InStr("123", Left(Selection.Text, 1)) = 0 Then _ Selection.MoveStart , 2 Selection.MoveEnd , 1 myChar = Right(Selection.Text, 1) myBook = Left(Selection, Len(Selection) - 2) pbGatewayPlus = myBook Do While InStr("0123456789,.:)- " & ChrW(8211) & vbCr, myChar) > 0 Selection.MoveEnd , 1 myChar = Right(Selection.Text, 1) Debug.Print myChar If LCase(myChar) <> UCase(myChar) Then Selection.MoveEnd , -1 DoEvents Loop Do While InStr(".,!?/=*): """ & ChrW(2) & ChrW(13) & ChrW(60) & ChrW(8220) & _ ChrW(8212) & ChrW(8220) & ChrW(8221) & _ ChrW(8216) & ChrW(8217) & ChrW(8226), Selection.Characters.last) > 0 Selection.MoveEnd , -1 Loop Else endNow = Selection.End Selection.MoveLeft wdWord, 1 startNow = Selection.Start Selection.End = endNow Selection.Expand wdWord Do While InStr(ChrW(8217) & "' ", Right(Selection.Text, 1)) > 0 Selection.MoveEnd , -1 DoEvents Loop Selection.Start = startNow End If mySubject = Trim(Selection) End If mySubject = Replace(mySubject, " ", "+") mySubject = Replace(mySubject, "&", "%26") mySubject = Replace(mySubject, ChrW(8217), "'") mySubject = mySubject & "&version=" & myVersion ActiveDocument.FollowHyperlink Address:=mySite & mySubject Selection.Collapse wdCollapseEnd End Sub