Results 1 to 3 of 3
  1. #1
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    PPT close method (Office 2000+)

    I can not find a neat way of prompting the user to save a dirty presentation.
    I can test for ".Saved", but the ensuing Save, saveAs or Close just doesn't prompt the user asking if they want to save.

    Is this a case where I have to roll my own messagebox?

    <pre> Call ProjectStripper(os, docTemplate.VBProject, strAr)
    If docTemplate.Saved Then
    docTemplate.Close
    Else
    docTemplate.SaveAs (docTemplate.FullName)
    docTemplate.Close
    End If</pre>



    From the PPT 2000 VBA Help files: Close Method
    Closes the specified document window, presentation, or open freeform drawing.
    Caution When you use this method, PowerPoint will close an open presentation without prompting the user to save their work.
    To prevent the loss of work, use the Save method or the SaveAs method before you use the Close method.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: PPT close method (Office 2000+)

    PowerPoint VBA does not expose the built-in dialogs. In PowerPoint 2002 and higher, you can use the Application.FileDialog object, but this is not available in PowerPoint 2000. The following should work in all versions:

    Application.CommandBars.FindControl(ID:=748).Execu te

  3. #3
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: PPT close method (Office 2000+)

    Lovely! Thank You.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •