Link to home
Start Free TrialLog in
Avatar of FamousMortimer
FamousMortimerFlag for United States of America

asked on

VB.NET 'Object reference not set to an instance of an object' Loading PDF in Adobe PDF Reader Component

Hi Experts,

I am tring to create a form with a PDF viewer in a WPF application.  I am using QuickWPFMonthCalendar that i downloaded here: http://www.codeproject.com/Articles/34052/Quick-and-Simple-WPF-Month-view-Calendar

I created a form and added an AxAcroPDF Control but i receive Object reference not set to an instance of an object error.  Here is the code on Day double click, that is supposed to load a test pdf.

    Private Sub DayBoxDoubleClicked_event(ByVal e As NewAppointmentEventArgs) Handles AptCalendar.DayBoxDoubleClicked
        MessageBox.Show("You double-clicked on day " & CDate(e.StartDate).ToShortDateString(), "Calendar Event", MessageBoxButton.OK)
        Dim frmProject As New frmProjectDetails
        frmProject.AxAcroPDF1.LoadFile("D:\Temp\test.pdf")
        frmProject.Show()
    End Sub

Open in new window

Avatar of kaufmed
kaufmed
Flag of United States of America image

Which line throws the error?
Avatar of FamousMortimer

ASKER

Line 4.

I even tried putting this code in the form load event and it give the same error.
ASKER CERTIFIED SOLUTION
Avatar of FamousMortimer
FamousMortimer
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial