Link to PDF does not launch associated app

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

docu-track99
User
Posts: 518
Joined: Thu Dec 06, 2007 8:13 pm

Link to PDF does not launch associated app

Post by docu-track99 »

Is there a way to tell the activeX control to open the application associated with pdf instead of opening the pdf in the control. Just like the way a link to a word or excel document would open the associated application word or excel. The problem we are having is that the link causes the control to open a new document without going through our open logic.
Corwin - Tracker Sup
User
Posts: 664
Joined: Tue Nov 14, 2006 12:23 pm

Re: Link to PDF does not launch associated app

Post by Corwin - Tracker Sup »

You can try to use code like this:

Code: Select all

Private Sub CoPDFXCview1_OnEvent(ByVal nType As Long, ByVal Name As String, ByVal DataIn As Variant, dataOut As Variant, ByVal Flags As Long)
    If nType = PXCVA_EventTypes.PXCVA_OnDisplayPrompt Then
        If Name = "Prompts.ConfirmLaunchFile" Then
            Call CoPDFXCview1.GetProperty("Prompts.ConfirmLaunchFile.FileName", dataOut, 0)
            Dim intResponse As Integer
            
            intResponse = MsgBox(dataOut, _
                vbYesNo + vbQuestion, _
                "Open File?")
                
            Dim sLanch As String
            If intResponse = vbYes Then
                sLanch = "Yes"
            Else
                sLanch = "No"
            End If
            Call CoPDFXCview1.SetProperty("Prompts.ConfirmLaunchFile.UserChoice", sLanch, 0)
        End If
    End If
End Sub
HTH
docu-track99
User
Posts: 518
Joined: Thu Dec 06, 2007 8:13 pm

Re: Link to PDF does not launch associated app

Post by docu-track99 »

Thanks,

We will investigate.
User avatar
John - Tracker Supp
Site Admin
Posts: 5223
Joined: Tue Jun 29, 2004 10:34 am

Re: Link to PDF does not launch associated app

Post by John - Tracker Supp »

Ok - please let us know if you have any further problems :)
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com