kopeaus

write file properties to MXD using dsofile

Discussion created by kopeaus on Oct 1, 2010
Latest reply on Oct 1, 2010 by vini1
Hi All,

I'm looking to write to the file properties of an MXD with DSOfile from inside an ArcMap session.  The Problem is that ArcMap has the file locked and even though i'm running the DSOfile from inside ArcMap.  I can't get write access to the file properties.   Any suggestion?

Dim sFile As String = GetThisMXDPath()
Dim oSummProps As DSOFile.SummaryProperties
m_oDocument = New DSOFile.OleDocumentPropertiesClass
Try
            m_oDocument.Open(sFile, False, DSOFile.dsoFileOpenOptions.dsoOptionOpenReadOnlyIfNoWriteAccess)
Catch ex As Exception
End Try
' Here we can tell if file was open read-only...
'It always is
m_fOpenedReadOnly = m_oDocument.IsReadOnly


'Get the SummaryProperties...
oSummProps = m_oDocument.SummaryProperties
Try
            oSummProps.Subject = "mySubject"
            m_oDocument.Save()
            m_oDocument.Close()
        Catch ex As Exception
End Try

Outcomes