Problem with Presentation.Saved and brand new presentations

Microsoft OFFICE

    Sponsored Links


  • 1. loading document in MODI viewer
    Hi, I'm trying to load a tiff in the MODI Viewer Control. the form (actually is a child form) is in C# and I'm using FileName Property to load the tiff. It loads, but if I close the child form and I try to open it again (with same source file), the Viewer displys nothing. Loading (only once) different documents (tiff images) is OK, but loading again same file is not. Also there is Document Property which loads an open document into the viewer control. I think that the file remains open in memory. How can I open it again using Document Property or how can I dispose it when I close the child form, so I can use only FileName Property of the control ?
  • 2. How to make a treeview in Powerpoint?
    I would like to make a slide with a treeview menu for a presentation. I have found the Microsoft Treeview control, but I can't find a way to tell it which items it must contain. Some help needed on this. Wouter.
  • 3. MODI and XP
    We currently have an application that was developed on Windows 98, using the Kodak image ocx controls. However, this OCX controls are no longer available on Windows XP. Does any one know if we can download the Kodak OCX? or is the MODI available to Windows XP for developing on VB 6? Thanks in advance, Laura.
  • 4. "Program Running" Message
    I have an Access form with code attached to a "run" botton. The program takes awhile to finish so I want a message such as "Program Running, Stand By" to be displayed untill the program is complete. How do I do it?

Problem with Presentation.Saved and brand new presentations

Postby Ryjek Blady » Fri, 22 Jan 2010 06:37:43 GMT

I am writing a COM add-in for PowerPoint 2007 and I am experiencing a 
weird behavior for the Presentation.Saved property.

When I access it for a brand new empty Presentation (such as the one 
that is created after starting PowerPoint without any documents), it 
returns False. I would expect it to return True, since I haven't made 
any changes.

Here's a minimal add-in that demonstrates the problem. Just bring up 
PowerPoint and hit save - it will say that the presentation is NOT saved.

Public Class ThisAddIn

     Private Sub Application_PresentationBeforeSave(ByVal Pres As 
Microsoft.Office.Interop.PowerPoint.Presentation, ByRef Cancel As 
Boolean) Handles Application.PresentationBeforeSave
         If Not Pres.Saved Then
             MsgBox("Presentation " & Pres.Name & " is NOT saved")
         End If
     End Sub
End Class

It looks like just the act of accessing this property makes the 
presentation dirty. If I don't access this property, then PowerPoint 
closes the presentation without questions. If I do access it, then 
PowerPoint prompts me to save the file.

Interestingly, access to other properties such as Path, Name, 
DisplayComments, does not cause PowerPoint to prompt me to save the file 
when I close the presentation. It is just the access to Saved property 
that marks the presentation dirty.

I might add that in Word and Excel, this works as expected, i.e. Saved 
for a new empty document/workbook is False.

Is this a known bug? Are there any workarounds?

Thank you,

Re: Problem with Presentation.Saved and brand new presentations

Postby Steve Rindsberg » Fri, 22 Jan 2010 08:34:03 GMT

If the presentation's never been saved, the .Saved property would 
(reasonably, I think) return False.  The help file's a bit vague on this 
.. something on the lines of "True if the presentation has been saved 
since any changes were made"  but since it's never been saved at all, False 
seems reasonable.

From VBA, I can't repro the other behavior you describe, that accessing the 
property sets the dirty flag.  For example, from the immediate window, I 
can do 

? ActivePresentation.Saved

or the like, and PPT still lets me close the presentation w/o a prompt to 

If querying the .Saved property is the only thing you're doing after 
creating a new presentation, that does seem to be a bug.  Long live .Net, 
eh?  :-|

Re: Problem with Presentation.Saved and brand new presentations

Postby Ryjek Blady » Fri, 22 Jan 2010 23:46:47 GMT

teve Rindsberg wrote:

Returning False is not very helpful, though. I would like to know if I
need to prompt the user to save changes or not. Excel and Word for
example, return Saved=True for empty documents.

Strange. I could repro this in the Immediate window in PowerPoint 2007
SP2. ActivePresentation.Saved prints 0, and after that when I close I am
prompted if I want to save it.

I am afraid that it is not .Net's fault. Our real add-in is written as
classic COM in C++. I only put together this add-in in VB to check if
there is something in our code that we are doing wrong and that makes
the presentation dirty. Since both of them exhibit the same symptoms, it
is more likely that a problem lies with PowerPoint itself.


Re: Problem with Presentation.Saved and brand new presentations

Postby Steve Rindsberg » Sat, 23 Jan 2010 01:30:01 GMT

OK, I see the problem ... if the user starts a new presentation *and adds
content to it* the dirty flag isn't set. That definitely walks, talks and
smells like a bug. I'll report it. Since, strictly speaking, it does do what
the Help file says it should, MS may take the point of view that it's working as

You can tell whether or not the presentation's been saved by checking
ActivePresentation.Path (it'll be blank if the presentation's never been saved).
But that still doesn't help much in this situation.

This wouldn't be foolproof but it'd be a start:

With ActivePresentation

If .Slides.Count > 1 Then
' user's added content

With .Slides(1)
If .Shapes.Count > 2 Then
' User's added content

Then iterate through the shapes collection on Slide 1
If any shape's Len(.TextFrame.TextRange.Text) > 0
the user's added content

Re: Problem with Presentation.Saved and brand new presentations

Postby Ryjek Blady » Sat, 23 Jan 2010 02:28:38 GMT

teve Rindsberg wrote:

Well not really :-) I would state the problem like this:

If the user starts a new presentation and *does not* add any content,
then reading the Saved property makes the presentation dirty.


Re: Problem with Presentation.Saved and brand new presentations

Postby Steve Rindsberg » Sun, 24 Jan 2010 12:20:32 GMT

Ah. ANOTHER one with lots of legs.  

I'll report this too.  

Similar Threads:

1.grammer check; ex: are presentations not is presentations

2.Linking a one Presentation to Another Presentation

I have several presentations that are linked to my main presentation so when 
you click a link the secondary presentation opens up.  My problem is that 
everytime I click a link that new presentation opens, which is good, but it 
doesn't close when I link back to the "home page".  Is it possible to have a 
presentation close when you click the link back to the home page?

3.Protecting branding in a PPT2000 presentation

In order to protect the intellectual property of supplying 
companies I need to make sure that people can not delete 
or render certain images invisible. I was thinking of 
using an powerpoint Add-in (PPA or Com) to detect saving 
the presentation. Then I can verify if the position and 
presence of the images and correct them. In order to make 
them use the Add-in I'd like to hide the content to the 
Does anybody already do this kind of thing or is there 
another way to protect content without blocking the 
possibility for translation.



4.can't save new power point presentation to disk says read-only

I have office 2003. I made a new presentation in powerpoint and tried to save 
it for the first time to a rewriteable CD and it wouldn't save, said file is 
read-only. Every where I looked it said the file was "archive" not read-only. 
How do I get rid of read-only?

5.problem with saving a ppt presentation

Whenever my user attempts to do a Save As operation on a 
Power Point presentation, he gets an error message from 
Microsoft Visual Basic, stating "An unexpected error 
occurred: I/O 0. When he clicks on the OK button, it 
promply returns the same error message the same number of 
times as the number of files he has in the folder he's 
attempting to save the presentation in. So if he has 50 
files in that destination folder, he has to select the OK 
option 50 times before it gives the NEXT error mesage 
from, this time, Microsoft Powerpoint, stating something 
like: An error has occurred while creating a file dialog, 
save the file and restart Powerpoint.

Does anybody know what is going on here?

Thanks in advance.


6. Create new Presentation with Template attached using VBA

7. New Presentation Dialog using VBA

8. Saving Power point presentation slide as JPG

Return to Microsoft OFFICE


Who is online

Users browsing this forum: No registered users and 37 guest