Darren
2006-11-28 16:54:18 UTC
Has anyone tried to do this recently? (Yes, unfortunately there are
still many live systems written in VB6 ;) )
All the sample code I can find, dating from 2005 seems to be using the
wrong library:-
http://www.codenewsgroups.net/group/microsoft.public.vb.general.discussion/topic3577.aspx
Private mobjPDF As AcroPDFLibCtl.AcroPDF
Sub Form_Load()
Set mobjPDF = Controls.Add("AcroPDF.PDF.1", "Test")
mobjPDF.LoadFile DrawingName
End Sub
Private Sub Form_Unload(Cancel As Integer)
mobjPDF.LoadFile ""
End Sub
etc
'AcroPDFLibCtl' is invalid. V7 of the Browser Control actually has a
library of 'AcroPDFLib'
Even so, modifying the code to use the correct reference :-
Private mobjPDF As AcroPDFLib.AcroPDF
Sub Form_Load()
Set mobjPDF = Controls.Add("AcroPDF.PDF.1", "Test")
mobjPDF.LoadFile "sample.pdf"
End Sub
Private Sub Form_Unload(Cancel As Integer)
mobjPDF.LoadFile ""
End Sub
still brings back a 'Type Mismatch' error at the 'controls.add...'
line.
Thanks in advance.
D.
still many live systems written in VB6 ;) )
All the sample code I can find, dating from 2005 seems to be using the
wrong library:-
http://www.codenewsgroups.net/group/microsoft.public.vb.general.discussion/topic3577.aspx
Private mobjPDF As AcroPDFLibCtl.AcroPDF
Sub Form_Load()
Set mobjPDF = Controls.Add("AcroPDF.PDF.1", "Test")
mobjPDF.LoadFile DrawingName
End Sub
Private Sub Form_Unload(Cancel As Integer)
mobjPDF.LoadFile ""
End Sub
etc
'AcroPDFLibCtl' is invalid. V7 of the Browser Control actually has a
library of 'AcroPDFLib'
Even so, modifying the code to use the correct reference :-
Private mobjPDF As AcroPDFLib.AcroPDF
Sub Form_Load()
Set mobjPDF = Controls.Add("AcroPDF.PDF.1", "Test")
mobjPDF.LoadFile "sample.pdf"
End Sub
Private Sub Form_Unload(Cancel As Integer)
mobjPDF.LoadFile ""
End Sub
still brings back a 'Type Mismatch' error at the 'controls.add...'
line.
Thanks in advance.
D.