Have a VB6 form that opens and displays a PDF file. When exiting the VB6 form, I want to close the PDF file. After returning to the calling program, I want to Kill the PDF file that is residing in a directory.
I have submitted the code that I a using along with note commemts.
Would appreciate any help.
Private Const SW_SHOWNORMAL = 0.75
Private Const SW_CLOSE = True
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _
ByVal lpParameters As String, ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
'=== Put in the routine to display the PDF file ==================================
'Note: the PassString(6) carries the directory path and name of the previously
' saved PDF file
ShellExecute Me.hwnd, "open", PassString(6), vbNullString, _
'Note: The above code seems to work fine.
This is my attempt to close the file so that when
ShellExecute Me.hwnd, "close", PassString(6), vbNullString, vbNullString, 1
' Note: the code executes but the PDF file is not closed, it just moves down to
' the task bar at bottom of screen