To add non-standard page numbers, such as Mayan numerals, to a Word document using an Excel list, you can use a combination of VBA (Visual Basic for Applications) and Word fields. Here’s a general approach you can follow:
- Prepare Your Excel Data: Ensure your Excel document is structured correctly with Arabic numerals in Column A, Mayan numerals in Column B, and the written form in Q'eqchi' in Column C.
- Open Word and Access the VBA Editor: In Word, press
ALT + F11to open the VBA editor. - Create a New Module: In the VBA editor, right-click on any of the items in the Project Explorer, go to
Insert, and then clickModule. - Write the VBA Code: You can write a VBA macro that will loop through the pages of your Word document and pull the corresponding Mayan numeral and written form from your Excel file. Here’s a sample code snippet:
Sub InsertMayanPageNumbers() Dim xlApp As Object Dim xlWorkbook As Object Dim xlSheet As Object Dim i As Integer Dim pageNum As Integer Dim mayanNum As String Dim writtenNum As String ' Open Excel and the specific workbook Set xlApp = CreateObject("Excel.Application") Set xlWorkbook = xlApp.Workbooks.Open("C:\path\to\your\excel.xlsx") Set xlSheet = xlWorkbook.Sheets(1) ' Loop through each page in the Word document For i = 1 To ActiveDocument.ComputeStatistics(wdStatisticPages) pageNum = i mayanNum = xlSheet.Cells(pageNum, 2).Value ' Mayan numeral in Column B writtenNum = xlSheet.Cells(pageNum, 3).Value ' Written form in Column C ' Insert Mayan numeral in a text box in the footer With ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary) .Range.Text = "Page " & pageNum & " - " & mayanNum ' Optionally, you can add the written form here as well .Range.InsertAfter " - " & writtenNum End With Next i ' Clean up xlWorkbook.Close False xlApp.Quit Set xlSheet = Nothing Set xlWorkbook = Nothing Set xlApp = Nothing End Sub - Run the Macro: Close the VBA editor and run the macro from the Word interface (you may need to enable macros in Word).
- Font Consideration: Make sure to set the font of the text box to "Noto Sans Mayan Numerals" to properly display the Mayan numerals.
This approach will automate the process of inserting the custom page numbers into your Word document based on the data from your Excel file. Adjust the paths and ensure your Excel file is accessible from the Word macro.