Using Word 2010 64bit Edition
May I suggest the following changes:
In vbaKernelStuff
Code:
#If VBA7 Then
Private Declare PtrSafe Function WaitForSingleObject Lib "kernel32" ( _
ByVal hHandle As LongPtr, _
ByVal dwMilliseconds As Long) As Long
Private Declare PtrSafe Function OpenProcess Lib "kernel32.dll" ( _
ByVal dwDesiredAccess As Long, _
ByVal bInheritHandle As LongPtr, _
ByVal dwProcessId As LongPtr) As LongPtr
Private Declare PtrSafe Function CloseHandle Lib "kernel32" ( _
ByVal hObject As LongPtr) As Long
#Else
Private Declare Function WaitForSingleObject Lib "kernel32" ( _
ByVal hHandle As Long, _
ByVal dwMilliseconds As Long) As Long
Private Declare Function OpenProcess Lib "kernel32.dll" ( _
ByVal dwDesiredAccess As Long, _
ByVal bInheritHandle As Long, _
ByVal dwProcessId As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" ( _
ByVal hObject As Long) As Long
#End If
Code:
#If VBA7 Then
Dim TaskID As LongPtr
Dim ProcHandle As LongPtr
#Else
Dim TaskID As Long
Dim ProcHandle As Long
#End If
Without the above, it won't compile.
In datBookCreatorProperties, Sub INITIALIZE()
Code:
#If Win64 Then
setCalibrePath "C:\Program Files (x86)\calibre"
#Else
setCalibrePath "C:\Program Files\calibre"
#End If
That correction will only correct the path for 64bit word
Not sure how to correct it for 32bit word on Win64.
In eBookCreatorCalibre Sub html2any
Adding a bit of diagnostic on the calibre path, otherwise, it fails silently
Code:
' Prepare to create the eBook
szHTML2ANY = Replace(szPathCalibre, """", "") + "\ebook-convert.exe"
If Not IsFileExists(szHTML2ANY) Then
MsgBox "Calibre Path Incorrect"
Exit Sub
End If
szHTML2ANY = """" + szHTML2ANY + """"
AnyToHMTLToTarget szHTML2ANY, szFilepath, szFilename, szParam, True, eEBookFormat
Remark, I only corrected the NOIMP version, there may be more.
Also the BrowserFileSystem need a bit of improvement.