Stop pulling your hair. There's no need to re-invent the wheel.
Just let the pdf open in it's own reader. (no headaches)
Paste this code into a module and call the pdf (or ANY file): OpenNativeApp sFilePath
Option Compare Database
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpszOp As String, ByVal lpszFile As String, ByVal lpszParams As String, ByVal lpszDir As String, ByVal FsShowCmd As Long) As Long
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Const SW_SHOWNORMAL = 1
Const SE_ERR_FNF = 2&
Const SE_ERR_PNF = 3&
Const SE_ERR_ACCESSDENIED = 5&
Const SE_ERR_OOM = 8&
Const SE_ERR_DLLNOTFOUND = 32&
Const SE_ERR_SHARE = 26&
Const SE_ERR_ASSOCINCOMPLETE = 27&
Const SE_ERR_DDETIMEOUT = 28&
Const SE_ERR_DDEFAIL = 29&
Const SE_ERR_DDEBUSY = 30&
Const SE_ERR_NOASSOC = 31&
Const ERROR_BAD_FORMAT = 11&
Public Sub OpenNativeApp(ByVal psDocName As String)
Dim r As Long, msg As String
r = StartDoc(psDocName)
If r <= 32 Then
'There was an error
Select Case r
msg = "File not found"
msg = "Path not found"
msg = "Access denied"
msg = "Out of memory"
msg = "DLL not found"
msg = "A sharing violation occurred"
msg = "Incomplete or invalid file association"
msg = "DDE Time out"
msg = "DDE transaction failed"
msg = "DDE busy"
msg = "No association for file extension"
msg = "Invalid EXE file or error in EXE image"
msg = "Unknown error"
' MsgBox msg
Private Function StartDoc(psDocName As String) As Long
Dim Scr_hDC As Long
Scr_hDC = GetDesktopWindow()
StartDoc = ShellExecute(Scr_hDC, "Open", psDocName, "", "C:\", SW_SHOWNORMAL)
Your program line is great to open Adobe in this case
Problem is not that I can not open the PDF in report . separately
the problem is that the first part of my report is MS access with details and I need to show a pdf file of the various pictures (in PDF) at the end of my report. I have 3 options
1. Merge two PDF files when report is re-printed to PDF
2. Convert my label PDF into jpg then view it in report
3. Try to update some how latest PDF into last section of my report.
I have 800 various products and descriptions, they need to be updated at the end of my report.. However I can not re-read latest PDF file for each product. If I use one reference f.ex Product1234, if i change to Product1235 it is not updateable!