Option Explicit _____________________________________________________________________________________ Private Function ElyseTaylorPath() As String ElyseTaylorPath = ReturnTopPath & "\ElyseTaylorArt.com" If Not FileExists(ElyseTaylorPath) Then MsgBox "Cannot proceed. The website folder was not found:" & vbLf & ElyseTaylorPath, vbCritical, "Aborted!" End End If End Function _____________________________________________________________________________________ Private Sub ProcessSquares() ' is button on Dashboard sheet ProcessArt ElyseTaylorPath, "squares", "Elyse Taylor Art", "Growing Squares", False End Sub _____________________________________________________________________________________ Private Sub ProcessOtherArt() ' is button on Dashboard sheet ProcessArt ElyseTaylorPath, "other-art", "Elyse Taylor Art", "Other Art", True End Sub _____________________________________________________________________________________ Private Sub ProcessArt(Path As String, FolderName As String, HomePage As String, FolderTitle As String, CountIndexFlag As Boolean) ' CountIndexFlag turns on inserting into the index page the count for each primary page Dim test As Boolean Dim i As Integer, j As Integer, k As Integer Dim H As String, Prefix As String, t As String Dim NextFN As String, NextFT As String, PrevFN As String, PrevFT As String Dim Database, PageList, PagesToDo, RowNums, SizeFS, SubData As Variant Path = Path & "\" & FolderName & "\" ' Columns: 0-Filename, 1-Image name, 2-Primary Page, 3-Other Pages, 4-Dimensions, 5-Painting Name, 6-Optional Page Text Database = ReadInDelimData(Path & "ArtDatabase.txt", "|") ' find optional pages. we turn the list of pages into arrays For i = 0 To UBound(Database) If Database(i, 3) <> "" Then If InStr(Database(i, 3), ",") Then Database(i, 3) = Split(Database(i, 3), ",") Else Database(i, 3) = Array(Database(i, 3)) End If PageList = AppendVectors(PageList, Database(i, 3)) End If Next i ' array of 2 with the page name lists (primary and optional subsets) PagesToDo = Array(RemDupSameOrder(ReturnColumn(Database, 2)), RemDupSameOrder(PageList)) ' ~~ outer loop is columns for 0-primary page and 1-optional pages For k = 0 To 1 If k = 0 Then Prefix = "" Else Prefix = "../" End If PageList = PagesToDo(k) If IsEmpty(PageList) Then GoTo NoOptional ' loop for art type index pages For j = 0 To UBound(PageList) RowNums = Empty H = "" ' processing page for work of art For i = 0 To UBound(Database) If k = 0 Then test = Database(i, 2) = PageList(j) ElseIf IsArray(Database(i, 3)) Then test = IsMember(Database(i, 3), PageList(j)) Else test = False End If If test Then ' do we have a size or index? If Database(i, 4) <> "" Then t = " (" & Database(i, 4) & ")" Else t = "" End If ' add to thumbnail string H = H & "
" & vbCrLf & vbCrLf ' save row number for the artwork's own page RowNums = AppendVectors(RowNums, i) End If Next i ' save thumbnail code If k = 0 Then If CountIndexFlag Then InsertIntoHtm Path & "index.htm", 1 + UBound(RowNums), "" End If t = Path & "art-" & PageList(j) Else t = Path & PageList(j) & "\index" End If InsertIntoHtm t & ".htm", H ' ~~ the individual art pages ' Columns: 0-Filename, 1-Image name, 2-Primary Page, 3-Other Pages, 4-Dimensions, 5-Painting Name, 6-Optional Page Text SubData = SelectRows(Database, RowNums) For i = 0 To UBound(SubData) H = "" & vbCrLf H = H & "" & vbCrLf H = H & "" & vbCrLf H = H & "" & vbCrLf End If If SubData(i, 6) <> "" Or SubData(i, 4) <> "" Then H = H & "
"
End If
' build image string
SizeFS = GetImageSize(Path & "images\" & SubData(i, 1) & "-f.jpg")
H = H & ""
' close and save file
H = H & vbCrLf & "" & vbCrLf
If k = 0 Then
t = ""
Else
t = PageList(j) & "\"
End If
SaveIfChanged Path & t & SubData(i, 0) & ".htm", H
Next i
Next j
NoOptional:
Next k
End Sub
_____________________________________________________________________________________
Private Sub EditSquaresTable()
' is button on Dashboard sheet
' Columns: 0-Filename, 1-Image name, 2-Primary Page, 3-Other Pages, 4-Index, 5-Painting Name, 6-Optional Page Text
ExcelEditor ElyseTaylorPath & "\squares\ArtDatabase.txt", Array(6, 6, 6, 17, 5, 30, 35), Array("Name", "Image", "Year", "Other Pages", "Index", "Painting Name", "Optional Page Text")
Columns("E").NumberFormat = "@"
AddSaveExitButtons 300, "SaveSquaresTable"
Application.Calculation = xlCalculationAutomatic
End Sub
_____________________________________________________________________________________
Private Sub SaveSquaresTable()
' sub to above subroutine
RemoveBlankRows
SaveAsPipeFile ElyseTaylorPath & "\squares\ArtDatabase.txt", 2, 1, Range("A65536").End(xlUp).Row, 7
ExitDelimTable True
End Sub
_____________________________________________________________________________________
Private Sub EditOtherArtTable()
' is button on Dashboard sheet
' Columns: 0-Filename, 1-Image name, 2-Primary Page, 3-Other Pages, 4-Dimensions, 5-Painting Name, 6-Optional Page Text
ExcelEditor ElyseTaylorPath & "\other-art\ArtDatabase.txt", Array(22, 50, 17, 12, 7, 30, 15), Array("Filename", "Image Name", "Primary Page", "Other Pages", "Dim.", "Painting Name", "Optional Page Text")
AddSaveExitButtons 200, "SaveOtherArtTable"
Application.Calculation = xlCalculationAutomatic
End Sub
_____________________________________________________________________________________
Private Sub SaveOtherArtTable()
' sub to above subroutine
RemoveBlankRows
SaveAsPipeFile ElyseTaylorPath & "\other-art\ArtDatabase.txt", 2, 1, Range("A65536").End(xlUp).Row, 7
ExitDelimTable True
End Sub
_____________________________________________________________________________________
Private Sub RunETNavCode()
' is button on Dashboard sheet
ProcessAllNavRowsSub ElyseTaylorPath
End Sub
_____________________________________________________________________________________
Private Sub BuildElyseTaylorSitemap()
' is button on Dashboard sheet
CreateSiteMapFromOtherSheet ElyseTaylorPath
End Sub
_____________________________________________________________________________________
Private Sub SplitArtVBACode()
' is button on dashboard
VBAtext2Text ReturnTopPath & "\donwiss.com\spreadsheet\VBA-art.txt"
End Sub
_____________________________________________________________________________________