Private Declare Function PS_Init Lib "polspell.dll" () As Long
Private Declare Sub PS_Destroy Lib "polspell.dll" (ByVal hSpell As Long)
Private Declare Function PS_OpenDictionary Lib "polspell.dll" (ByVal hSpell As Long, ByVal pszMainDictFileName As String, ByVal pszCustomDictFileName As String) As Boolean
Private Declare Sub PS_CloseDictionary Lib "polspell.dll" (ByVal hSpell As Long)
Private Declare Function PS_CheckText Lib "polspell.dll" (ByVal hSpell As Long, ByVal pszText As String, pnExitStatus As Integer) As Long
Private Declare Function PS_DownloadDictionaries Lib "polspell.dll" (ByVal hSpell As Long, ByVal pszUpdateURL As String, ByVal pszInstallDir As String) As Boolean
Private Declare Function PS_OptionsDialog Lib "polspell.dll" (ByVal pszDictionaryDir As String, ByVal pszCustomDicFileName As String, ByVal pszCurDicFileName As String, ByVal pszDownloadURL As String, ByVal bInternetSupport As Boolean) As Boolean
Private Declare Function GlobalLock Lib "kernel32" (ByVal hMem As Long) As Long
Private Declare Function GlobalUnlock Lib "kernel32" (ByVal hMem As Long) As Long
Private Declare Function GlobalFree Lib "kernel32" (ByVal hMem As Long) As Long
Private Declare Sub CopyMemory Lib "kernel32" (Dest As Any, Source As Any, ByVal NumBytes As Long)
Private Declare Function lstrlen Lib "kernel32" Alias "lstrlenA" (ByVal lpstr As Any) As Long
Private Declare Sub lstrcpy Lib "kernel32" Alias "lstrcpyA" (ByVal Dest As Any, ByVal src As Any)
Dim g_strMainDictFileName As String
Dim g_strCustomDictFileName As String
Dim g_hSpell As Long
Private Sub btnCheckAll_Click()
Dim Text As String
Dim hglbMem As Long
Dim psz As Long
Dim ExitStatus As Integer
' Open dictionary
If PS_OpenDictionary(g_hSpell, App.Path + "\" + g_strMainDictFileName, g_strCustomDictFileName) <> False Then