Preview a pdf question

johnob

Registered User.
Local time
Today, 05:04
Joined
Jan 12, 2014
Messages
45
Hi all,

Is there anyway to preview a pdf file within a form ?

the sample db is what im looking for , but in the preview window have it show what file to show, pending on what is selected.

Thank you
 
Last edited:
I did not download your db but maybe this will help. Of course edit to suit your needs.
AcroPDF7.LoadFile (FullPathNameToFile)
AcroPDF7.setShowToolbar (True)
AcroPDF7.setView ("Width")


Another Option:

Insert the PDF activeX control and name it "viewer".
Make sure you add the Adobe OLE reference ("adobe"), if not the code will be undefined.

Code:
Private Sub cmdView_Click()
Dim AcroApp As CAcroApp
Dim AVDoc As CAcroAVDoc
Dim PDDoc As CAcroPDDoc
Set AVDoc = CreateObject("AcroExch.AVDoc")
Set AcroApp = CreateObject("AcroExch.App")
Set PDDoc = AVDoc.GetPDDoc


Me.Viewer.loadFile ("C:\yourfile.pdf")

End Sub
 
Last edited:
thank you, with a little try and error I got it working.

I have updated the sample db with the code
Code:
Private Sub AcroPDF5_GotFocus()

Me.AcroPDF5.LoadFile ("D:\ResMed Reports\12 to 19May 2014.pdf")

End Sub
This works if you only want that pdf file to be shown, I have different 2 pdf's for each new form created,
On the sample db you can do it to a text box using code
Code:
=IIf([Check51]=Yes,[View Report],IIf([Check53]=Yes,[View Report Details],"No report selected"))
How would you do that to the ActiveX Control / VB

Thanks
 
Last edited:
I did not download your db and have no real experience sending multiple attachments,sorry.
Maybe someone else can assist with this.

Good Luck.
 

Users who are viewing this thread

Back
Top Bottom