J
Jim Shank
I am trying to do some background processing on PowerPoint 2003 presentation
files using the automation interface through Visual Basic .NET. When the
process accesses write protected (password) files, a prompt is being shown
requesting the password or readonly, I would like to avoid this. I am
specifying readonly in the open method. The other issue is when I close the
file, even when readonly is selected, I get a COMException of "Presentation
(unknown memeber): Invalid Request. Presentation cannot be modified."
Here is the code
Dim m_PowerPointApp As PowerPoint.ApplicationClass
Dim presentation As PowerPoint.Presentation
m_PowerPointApp = New PowerPoint.ApplicationClass
m_powerpointIsOpen = True
m_PowerPointApp.DisplayAlerts =
PowerPoint.PpAlertLevel.ppAlertsNone
presentation =
m_PowerPointApp.Presentations.Open(m_fileName.FullName, ReadOnly:=msoTrue,
WithWindow:=msoFalse)
' Do some reading stuff (nothing is changed)
presentation.Close() ' <-- Here is where the error occurrs
Thanks in advance for any ideas or the solution to this issue. I am running
Office 2003 SP1 on Windows XP SP2. Developing in Visual Studio .NET 2003.
files using the automation interface through Visual Basic .NET. When the
process accesses write protected (password) files, a prompt is being shown
requesting the password or readonly, I would like to avoid this. I am
specifying readonly in the open method. The other issue is when I close the
file, even when readonly is selected, I get a COMException of "Presentation
(unknown memeber): Invalid Request. Presentation cannot be modified."
Here is the code
Dim m_PowerPointApp As PowerPoint.ApplicationClass
Dim presentation As PowerPoint.Presentation
m_PowerPointApp = New PowerPoint.ApplicationClass
m_powerpointIsOpen = True
m_PowerPointApp.DisplayAlerts =
PowerPoint.PpAlertLevel.ppAlertsNone
presentation =
m_PowerPointApp.Presentations.Open(m_fileName.FullName, ReadOnly:=msoTrue,
WithWindow:=msoFalse)
' Do some reading stuff (nothing is changed)
presentation.Close() ' <-- Here is where the error occurrs
Thanks in advance for any ideas or the solution to this issue. I am running
Office 2003 SP1 on Windows XP SP2. Developing in Visual Studio .NET 2003.