Simple Office VBA Macros to turn selected office bible references into Logos links.

Henrik Guldager Andersen
Henrik Guldager Andersen Member Posts: 23
edited November 21 in English Forum

I am not a programmer but I wrote some simple VBA macros to turn selected office bible references into Logos hyperlinks that opens the app. 

I disabled hyperlinks warning to make it more fluent.

Improvements are welcome.

Dim Version As String

Sub ChooseVersion()


Version = InputBox("Write Logos Bible Code", "Logos Bible Version", "NASB95")

End Sub

Sub LogosLink()

Dim Charaters As Integer


If IsEmpty(Selection) = True Then Exit Sub

Characters = Selection.Characters.Count

If Characters > 12 Then Exit Sub
If Characters < 5 Then Exit Sub

If Version = "" Then ChooseVersion

ActiveDocument.Hyperlinks.Add Anchor:=Selection.Range, Address:= _
"logosres:" & Version & ";ref=Bible" & Version & "." & Selection, SubAddress:="", ScreenTip:="Open verse in Logos", _
TextToDisplay:=Selection

End Sub

Sub removelink()

Dim i As Integer
Dim n As Integer


n = Selection.Hyperlinks.Count

For i = n To 1 Step -1

Selection.Hyperlinks(i).Delete

Next i

End Sub

Sub ClearVersion()

Version = ""

End Sub

Tagged:

Comments