How to get OpenDialog item?

I have the following code and it’s bugging me with a NillObject Exception:

  Dim RiivolutionOpenFile As New OpenDialog
  Dim RxmlFile As FolderItem
  Dim RiiDocument As XmlDocument
  
  RiivolutionOpenFile.Title = "Open Riivolution XML File"
  RiivolutionOpenFile.Filter = FileTypes1.XML
  RiivolutionOpenFile.InitialDirectory = SpecialFolder.Documents
  RxmlFile = RiivolutionOpenFile.ShowModal
  
  
  If RxmlFile <> Nil Then
    RiiDocument.LoadXml(GetOpenFolderItem(RxmlFile.URLPath)) //The Nill Object Exception.
  Else
    //User Cancelled
  End If

How would I be able to load item selected from my Open Dialog? Thanks,
Shane.

RiiDocument is nil.

RiiDocument.LoadXml(RxmlFIle)

Still Nill Object Exception.

RiiDocument = New xmldocument
RiiDocument.LoadXml(RxmlFIle)

[quote=11960:@Wayne Golding]RiiDocument = New xmldocument
RiiDocument.LoadXml(RxmlFIle)[/quote]

-_-

Cant believe I forgot to make it a new object. Was thinking about something else and totally forgot about declaring new objects as new.

Sometimes it just takes a fresh pair of eyes.

Thanks.

I got my app to read the Wii Disc tag and Game ID tag. My Riivolution XML Editor is coming along nicely. When I feel I’m ready to so, I’ll create a Github repository for it. Closed source sucks in the game modding world.

It was actually Brad the got the correct answer first. We must have posted almost exactly at the same time.