![]() ![]() ![]() 'Author : Ken Puls ( 'Macro Purpose: Print to PDF file using PDFCreator Note the requirement foe reference to PDFCreator cStart("/NoProcessingAtStartup") = False Then KillProcess (PDFCreator.exe) Else Set pdfjob = CreateObject("PDFCreator.clsPDFCreator") RProcessFound = ProcessNext(hSnapshot, uProcess) MyProcess = OpenProcess(PROCESS_ALL_ACCESS, False, uProcess.th32ProcessID)ĪppKill = TerminateProcess(MyProcess, ExitCode) If Right$(SzExename, Len(NameProcess)) = LCase$(NameProcess) Then SzExename = LCase$(Left$(uProcess.szexeFile, i - 1)) RProcessFound = ProcessFirst(hSnapshot, uProcess) HSnapshot = CreateToolhelpSnapshot(TH32CS_SNAPPROCESS, 0&) Public Sub KillProcess(NameProcess As String) ' # THE FOLLOWING TERMINATES PDFCREATOR IS ALREADY RUNNING # I'm using PDF Creator 0.9.3.Ĭan anyone see anything obvious that's wrong with the following code?ĭeclare Function OpenProcess Lib "kernel32.dll" (ByVal dwDesiredAccess As Long, ByVal blnheritHandle As Long, ByVal dwAppProcessId As Long) As Longĭeclare Function ProcessFirst Lib "kernel32.dll" Alias "Process32First" (ByVal hSnapshot As Long, uProcess As PROCESSENTRY32) As Longĭeclare Function ProcessNext Lib "kernel32.dll" Alias "Process32Next" (ByVal hSnapshot As Long, uProcess As PROCESSENTRY32) As Longĭeclare Function CreateToolhelpSnapshot Lib "kernel32.dll" Alias "CreateToolhelp32Snapshot" (ByVal lFlags As Long, lProcessID As Long) As Longĭeclare Function TerminateProcess Lib "kernel32.dll" (ByVal ApphProcess As Long, ByVal uExitCode As Long) As Longĭeclare Function CloseHandle Lib "kernel32.dll" (ByVal hObject As Long) As Long Hi - thanks for looking at this post! I have the following code which with a couple of tweaks works fine in excel but when I run this in word it hangs at the point where it is spooling. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |