This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Function Phonetics(InputWord As String, Optional EngType As String = "ICAO") As String | |
| 'Convert Words to Phonetic Alphabet | |
| 'Phonetics version 1.0 by Pongsathorn Sraouthai | |
| 'Support English and Thai only | |
| 'EngType: | |
| 'ICAO = ICAO phonetics alphabet | |
| 'animal = animal phonetics alphabet | |
| 'fruit = fruit phonetics alphabet | |
| 'baby = baby phonetics alphabet | |
| 'police = Law Enforcement phonetics alphabet |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Function EnglishTime(InTime, Optional Formal As Integer = 1) | |
| 'Convert Time to English Text | |
| 'Formal | |
| '1 = Formal | |
| '2 = Informal | |
| '3 = Military | |
| Dim tInput, ThH, ThM, ThS | |
| Select Case VarType(InTime) | |
| Case vbDate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Public Function ThaiTime(InTime, Optional TimeType As Integer = 1, Optional CType As Integer = 0) | |
| 'Version 4.0 | |
| 'แปลงเลขเวลาเป็นคำอ่าน | |
| 'TimeType รองรับได้ 6 แบบ | |
| '1 ระบบ 24 ชั่วโมงแบบราชการ | |
| '2 ระบบ 6 ชั่วโมงแบบ 2490 | |
| '3 ระบบ 6 ชั่วโมงแบบสมียใหม่ 2535 | |
| '4 ระบบ 24 ชั่วโมงแบบทหาร | |
| '5 ระบบ 8 ยาม แบบอยุธยา 2076 | |
| '6 ระบบ 8 ยาม แบบรัตนโกสินทร์ 2443 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Function W2U(iText As String) | |
| 'Convert Words to unicode number of character | |
| Dim N, AllChar | |
| For N = Len(iText) To 1 Step -1 | |
| AllChar = AscW(Mid(iText, N, 1)) & " " & AllChar | |
| Next | |
| W2U = AllChar | |
| End Function | |
| Function U2W(iCode) As String |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Public Function LNLDate(iDate As Date, Optional DispNumber As Integer = 0, Optional Zodiac As Integer = 0, Optional Era As Integer = 0, Optional DhammaDay As Boolean = False, Optional NumberOnly As Boolean = False) | |
| 'LNLDate = Lanna Lunar Date สำหรับแสดงผลวันที่แบบจันทรคติล้านนา | |
| 'แปลงวันที่แบบสุริยคติให้เป็นจันทรคติ | |
| 'Copyright 2022 and later by Pongsathorn Sraouthai | |
| 'Version 2.0 Optimized for faster calculation | |
| 'Inspired by Loy's calculation | |
| 'ตัวแปร | |
| 'iDate = วันที่ ที่ใช้อ้างอิง | |
| 'DispNumber = แสดงผลตัวเลข 0 เลขอารบิก 1 เลขไทย 2 เลขโหราล้านนา |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Option Explicit | |
| Private Function XLMod(a, b) | |
| ' This attempts to mimic the Excel MOD function | |
| XLMod = a - b * Int(a / b) | |
| End Function | |
| Function AthikaMas(iYear As Integer) As Boolean | |
| 'AthikaMas calculation | |
| 'Return True if the specified year is AthikaMas. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Option Explicit | |
| Private Function XLMod(a, b) | |
| 'สำหรับใช้แทน mod ของ vba เนื่องจาก mod operator ของ vba ไม่รองรับเลขทศนิยม | |
| XLMod = a - b * Int(a / b) | |
| End Function | |
| Function AthikaMas(iYear As Integer) As Boolean | |
| 'สูตรสำหรับคำนวณปีอธิกมาส | |
| 'Return True if the specified year is AthikaMas. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Sub ETCorrection() | |
| 'For convert miss spelling in keyboard language from English to Thai (Spelling Thai in English Keyboard) | |
| 'by Pongsathorn Sraouthai | |
| Dim i, s | |
| Dim EngChar | |
| Dim ThaChar | |
| Dim EngArray As Variant | |
| Dim ThaArray As Variant | |
| Dim msg As Outlook.MailItem |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Function ETConv(iText As String) | |
| 'For convert miss spelling in keyboard language from English to Thai (Spelling Thai in English Keyboard) | |
| 'English Keyboard | |
| Dim e1 '1st row | |
| 'Thai Kedmanee Keyboard | |
| Dim t1 '1st row | |
| Dim eArray As Variant | |
| Dim tArray As Variant | |
| Dim i |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Sub ETCorrection() | |
| 'For correction miss spelling from English to Thai. | |
| Dim i | |
| Dim EngChar | |
| Dim ThaChar | |
| Dim EngArray As Variant | |
| Dim ThaArray As Variant | |
| EngChar = "1 2 3 4 5 6 7 8 9 0 - = ! @ # $ % ^ & * ( ) _ + q w e r t y u i o p [ ] \ Q W E R T Y U I O P { } | a s d f g h j k l ; ' A S D F G H J K L : "" z x c v b n m , . / Z X C V B N M < > ?" | |
| EngArray = Split(EngChar, " ") |