AnsweredAssumed Answered

Open New Map

Question asked by navjohn on Apr 25, 2012
Latest reply on Apr 26, 2012 by navjohn
I am trying to open a new document (ArcScene file) using IApplication.Document.Parent.OpenDocument(File_Name).
The problem I have is that this does not reset my m_pApp IApplication variable - presumably because of the Parent object in the OpenDocument.

The process I currently have running has a document called SHB.sxd open. It tries to open ANZ.sxd.

Run on startup:
 Private m_pApp as IApplication.   m_pApp = CType(hook, IApplication) 

Run later:

  ' Close the current map    m_pApp.Document.Parent.OpenDocument(sFile) ' Open ANZ    sName = m_pApp.Document.Title    pDoc = m_pApp.Document

When this code is run the sName string still contains the original document name 'SHB' rather than 'ANZ'.

How can I reset m_pApp so that it contains the sFile document (ANZ) data rather than the SHB document data?