Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Sub Start_End()
Selection.Text = "Add to start " & Selection.Text & _
" Add to end"
End Sub
Sub AddTags()
With Selection.Find
.MatchWildcards = True
.ClearFormatting
.Replacement.ClearFormatting
.Text = "([!^13]{1,})"
.Replacement.Text = "<a href=""ancient_classics/\1</a>"
.Wrap = wdFindStop
.Execute Replace:=wdReplaceAll
End With
End Sub
Sub ByTest()
Application.ScreenUpdating = False
Dim StrBkTrv As String, StrStrt As String, StrEnd As String, StrTmp As String, StrTtl As String
StrBkTrv = ".epub"" title=""New free eBooks on eBookTrove-dot-com, and being added to all the time."">"
StrStrt = "<a href=""ancient_classics/"
StrEnd = "</a><br />"
With ActiveDocument.Range
With .Find
.MatchWildcards = True
.ClearFormatting
.Replacement.ClearFormatting
.Wrap = wdFindStop
.Execute Replace:=wdReplaceAll
.Text = "[!^13]{1,}"
.Replacement.Text = ""
.Execute
End With
Do While .Find.Found
StrTmp = Split(.Text, ".epub")(0)
StrTmp = Trim(Replace(StrTmp, "_", " "))
If InStr(StrTmp, "by ") = 0 Then .HighlightColorIndex = wdYellow
.Collapse wdCollapseEnd
.Find.Execute
Loop
End With
Application.ScreenUpdating = True
End Sub
Sub AddTags()
Application.ScreenUpdating = False
Dim StrBkTrv As String, StrStrt As String, StrEnd As String, StrTmp As String, StrTtl As String
StrBkTrv = ".epub"" title=""New free eBooks on eBookTrove-dot-com, and being added to all the time."">"
StrStrt = "<a href=""ancient_classics/"
StrEnd = "</a><br />"
With ActiveDocument.Range
With .Find
.MatchWildcards = True
.ClearFormatting
.Replacement.ClearFormatting
.Wrap = wdFindStop
.Execute Replace:=wdReplaceAll
.Text = "[!^13]{1,}"
.Replacement.Text = ""
.Execute
End With
Do While .Find.Found
StrTmp = Split(.Text, ".epub")(0)
StrTmp = Trim(Replace(StrTmp, "_", " "))
While Right(StrTmp, 1) = "."
StrTmp = Left(StrTmp, Len(StrTmp) - 1)
Wend
While InStr(StrTmp, " ") > 0
StrTmp = Replace(StrTmp, " ", " ")
Wend
StrTmp = Replace(StrTmp, " ", "_")
StrTtl = ProperCase(StrTxt:=Replace(StrTmp, "_", " "), bCaps:=False, bExcl:=False)
.Text = StrStrt & StrTmp & StrBkTrv & StrTtl & StrEnd
If InStr(StrTtl, "by ") = 0 Then .HighlightColorIndex = wdYellow
.Collapse wdCollapseEnd
.Find.Execute
Loop
End With
Application.ScreenUpdating = True
End Sub
Function ProperCase(StrTxt As String, Optional bCaps As Boolean, Optional bExcl As Boolean) As String
'Convert an input string to proper-case.
'Surnames like O', Mc & Mac and hyphenated names are converted to proper case also.
'If bCaps = False, then upper-case strings like ABC are preserved; otherwise they're converted.
'If bExcl = False, words in the exclusion list are retained as lower-case, unless after specified punctuation marks.
Dim i As Long, j As Long, k As Long, l As Long, bFnd As Boolean
Dim StrChr As String, StrExcl As String, StrMac As String, StrPunct As String, StrTmpA As String, StrTmpB As String
'exclusion list
StrExcl = " a , an , and , as , at , but , by , for , from , if , in , is , of , on , or , the , this , to , with "
' Mac name lower-case list
StrMac = "Macad,Macau,Macaq,Macaro,Macass,Macaw,Maccabee,Macedon,Macerate,Mach,Mack,Macle,Macrame,Macro,Macul,Macumb"
StrPunct = "!,:,.,?,"""
If bExcl = True Then
StrExcl = ""
StrPunct = ""
End If
If Len(Trim(StrTxt)) = 0 Then
ProperCase = StrTxt
Exit Function
End If
If bCaps = True Then StrTxt = LCase(StrTxt)
StrTxt = " " & StrTxt & " "
For i = 1 To UBound(Split(StrTxt, " "))
StrTmpA = " " & Split(StrTxt, " ")(i) & " "
StrTmpB = UCase(Left(StrTmpA, 2)) & Right(StrTmpA, Len(StrTmpA) - 2)
StrTxt = Replace(StrTxt, StrTmpA, StrTmpB)
Next i
StrTxt = Trim(StrTxt)
'Code for handling O' names
For i = 1 To UBound(Split(StrTxt, "'"))
If InStr(Right(Split(StrTxt, "'")(i - 1), 2), " ") = 1 Or _
Right(Split(StrTxt, "'")(i - 1), 2) = Right(Split(StrTxt, "'")(i - 1), 1) Then
StrTmpA = Split(StrTxt, "'")(i)
StrTmpB = UCase(Left(StrTmpA, 1)) & Right(StrTmpA, Len(StrTmpA) - 1)
StrTxt = Replace(StrTxt, StrTmpA, StrTmpB)
End If
Next
'Code for handling hyphenated names
For i = 1 To UBound(Split(StrTxt, "-"))
StrTmpA = Split(StrTxt, "-")(i)
StrTmpB = UCase(Left(StrTmpA, 1)) & Right(StrTmpA, Len(StrTmpA) - 1)
StrTxt = Replace(StrTxt, StrTmpA, StrTmpB)
Next
'Code for handling names starting with Mc
If Left(StrTxt, 2) = "Mc" Then
Mid(StrTxt, 3, 1) = UCase(Mid(StrTxt, 3, 1))
End If
i = InStr(StrTxt, " Mc")
If i > 0 Then
Mid(StrTxt, i + 3, 1) = UCase(Mid(StrTxt, i + 3, 1))
End If
'Code for handling family names starting with Mac
If Left(StrTxt, 3) = "Mac" Then
bFnd = False
For j = 0 To UBound(Split(StrMac, ","))
If InStr(Split(StrTxt, " ")(0), Split(StrMac, ",")(j)) > 0 Then
bFnd = True
Exit For
End If
Next
If bFnd = False Then
If Len(Split(Trim(StrTxt), " ")(0)) > 4 Then
Mid(StrTxt, 4, 1) = UCase(Mid(StrTxt, 4, 1))
End If
End If
End If
i = InStr(StrTxt, " Mac")
If i > 0 Then
If Len(StrTxt) > i + 4 Then
bFnd = False
For j = 0 To UBound(Split(StrMac, ","))
If InStr(Split(Mid(StrTxt, i + 1, Len(StrTxt) - i - 1), " ")(0), Split(StrMac, ",")(j)) > 0 Then
bFnd = True
Exit For
End If
Next
If bFnd = False Then
Mid(StrTxt, i + 4, 1) = UCase(Mid(StrTxt, i + 4, 1))
End If
End If
End If
'Code to restore excluded words to lower case
For i = 0 To UBound(Split(StrExcl, ","))
StrTmpA = Split(StrExcl, ",")(i)
StrTmpB = UCase(Left(StrTmpA, 2)) & Right(StrTmpA, Len(StrTmpA) - 2)
If InStr(StrTxt, StrTmpB) > 0 Then
StrTxt = Replace(StrTxt, StrTmpB, StrTmpA)
'Make sure an excluded words following punctution marks are given proper case anyway
For j = 0 To UBound(Split(StrPunct, ","))
StrChr = Split(StrPunct, ",")(j)
StrTxt = Replace(StrTxt, StrChr & StrTmpA, StrChr & StrTmpB)
Next
End If
Next
ProperCase = StrTxt
End Function
Application.ScreenUpdating = False
Dim StrBkTrv As String, StrStrt As String, StrEnd As String, StrTmp As String, StrTtl As String
StrBkTrv = ".epub"" title=""New free eBooks on eBookTrove-dot-com, and being added to all the time."">"
StrStrt = "<a href=""ancient_classics/"
StrEnd = "</a><br />"
With ActiveDocument.Range
Application.ScreenUpdating = False
Dim StrTmp As String
With ActiveDocument.Range
If InStr(StrTmp, "by ") = 0 Then .HighlightColorIndex = wdYellow
If InStr(StrTmp, " by ") = 0 Then .HighlightColorIndex = wdYellow