Avatar of FamousMortimer
FamousMortimer
Flag 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

Visual Basic.NET

Avatar of undefined
Last Comment
FamousMortimer

8/22/2022 - Mon
kaufmed

Which line throws the error?
FamousMortimer

ASKER
Line 4.

I even tried putting this code in the form load event and it give the same error.
Nasir Razzaq

Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
ASKER CERTIFIED SOLUTION
FamousMortimer

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
FamousMortimer

ASKER
--