Skip to content

Implement Presentation.AutoSaveOn property in PowerPointApi #439

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kev-is-coding-for-adn
Copy link

Add AutoSaveOn property in PowerPoint Api

Copy link
Author

@kev-is-coding-for-adn kev-is-coding-for-adn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I said, I tested this approach using an extension, but it doesn't seem to return the value of the AutoSaveOn property.

/// SupportByVersion PowerPoint 16
/// Get/Set
/// </summary>
/// <remarks> Docs: <see href="https://learn.microsoft.com/fr-fr/office/vba/api/powerpoint.presentation.autosaveon"/> </remarks>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the link to the English documentation.

@jozefizso
Copy link
Member

Does this implementation work for you?

@kev-is-coding-for-adn
Copy link
Author

In fact, it appears this property is not accessible through API. It's only a VBA helper to deactivate AutoSave. I didn't find a way to access it another way. Too bad.

@jozefizso
Copy link
Member

Weird, this property exists in Excel and it works.

All the stuff from VBA model exists in COM objects too.

I can check if it's exposed on Mac.

@kev-is-coding-for-adn
Copy link
Author

Let me know if it works for you. I trully would need this property to be available! Thanks

@jozefizso
Copy link
Member

Here are all the members of the Presentation object in PowerPoint on Mac 16.95.4.

The AutoSaveOn property exists there.

Member SaveCopyAs2: 2135 -1 -1 (0x600000d38c28)
Member Redo: 2134 -1 -1 (0x600000d38da8)
Member Undo: 2133 -1 -1 (0x6000008b09a8)
Member AutoSaveOn: -1 2129 2129 (0x600000a6bfe8)
Member IsProtected: -1 2131 -1 (0x600000a6bfa8)
Member SectionProperties: -1 2111 -1 (0x600000a6bf28)
Member SnapToGrid: -1 2061 2061 (0x600000d38e68)
Member ApplyTheme: 2105 -1 -1 (0x600000a6bea8)
Member ReadOnlyRecommended: -1 2136 -1 (0x600000d38f28)
Member sectionTitle: 2093 -1 -1 (0x600000a6bda8)
Member DeleteSection: 2091 -1 -1 (0x600000a6bd28)
Member NewSectionAfter: 2090 -1 -1 (0x600000a6bce8)
Member HasSections: -1 2089 -1 (0x600000a6bca8)
Member SectionCount: -1 2088 -1 (0x600000a6bc68)
Member Guides: -1 2127 -1 (0x600000d15a68)
Member Password: -1 2080 2080 (0x600000a6bbe8)
Member WritePassword: -1 2081 2081 (0x600000a6bc28)
Member RemoveBaseline: 2074 -1 -1 (0x600000a6bba8)
Member AddBaseline: 2073 -1 -1 (0x600000a6bb68)
Member HasRevisionInfo: -1 2072 -1 (0x600000a6bb28)
Member WebOptions: -1 2053 -1 (0x600000a6ba28)
Member SlideShowWindow: -1 2047 -1 (0x600000a6b9e8)
Member CheckInWithVersion: 2095 -1 -1 (0x600000a6be68)
Member NoLineBreakAfter: -1 2045 2045 (0x600000a6b968)
Member CustomerData: -1 2106 -1 (0x600000a6bee8)
Member DisplayComments: -1 2042 2042 (0x600000a6b8a8)
Member Export: 2038 -1 -1 (0x600000a6b7a8)
Member FullName: -1 2024 -1 (0x600000a01ce8)
Member SaveAs: 2036 -1 -1 (0x600000a6b728)
Member PrintOut: 2034 -1 -1 (0x600000a6b6a8)
Member GridDistance: -1 2062 2062 (0x600000d154e8)
Member PrintOptions: -1 2033 -1 (0x600000a6b628)
Member CheckIn: 2065 -1 -1 (0x600000a6baa8)
Member Unused: 2032 -1 -1 (0x600000a6b568)
Member Broadcast: -1 2118 -1 (0x600000a6bf68)
Member NewWindow: 2029 -1 -1 (0x600000a01e28)
Member LayoutDirection: -1 2028 2028 (0x600000a01de8)
Member ReadOnly: -1 2023 -1 (0x600000a01ca8)
Member CustomDocumentProperties: -1 2021 -1 (0x600000a01c28)
Member AddRef: 1610612737 -1 -1 (0x600000a01528)
Member FollowHyperlink: 2030 -1 -1 (0x600000a6b5a8)
Member HasTitleMaster: -1 2005 -1 (0x600000a017a8)
Member BuiltInDocumentProperties: -1 2020 -1 (0x600000a01ba8)
Member DefaultShape: -1 2019 -1 (0x600000a01b28)
Member CanCheckIn: 2066 -1 -1 (0x600000a6bae8)
Member Windows: -1 2017 -1 (0x600000a01aa8)
Member SaveAsMovieSettings: -1 2132 -1 (0x6000008b08e8)
Member Save: 2035 -1 -1 (0x600000a6b6e8)
Member QueryInterface: 1610612736 -1 -1 (0x600000a01368)
Member HandoutMaster: -1 2010 -1 (0x600000a018e8)
Member SlideShowSettings: -1 2015 -1 (0x600000a01a28)
Member Close: 2039 -1 -1 (0x600000a6b7e8)
Member Application: -1 2001 -1 (0x600000a016a8)
Member ExtraColors: -1 2014 -1 (0x600000a019e8)
Member GetTypeInfoCount: 1610678272 -1 -1 (0x600000a013e8)
Member RemoveDocumentInformation: 2094 -1 -1 (0x600000a6be28)
Member SlideMaster: -1 2003 -1 (0x600000a01728)
Member NotesMaster: -1 2009 -1 (0x600000a018a8)
Member Slides: -1 2011 -1 (0x600000a01928)
Member Container: -1 2041 -1 (0x600000a6b868)
Member Tags: -1 2018 -1 (0x600000a01ae8)
Member NoLineBreakBefore: -1 2044 2044 (0x600000a6b928)
Member TemplateName: -1 2008 -1 (0x600000a01868)
Member ApplyTemplate: 2007 -1 -1 (0x600000a01828)
Member Saved: -1 2027 2027 (0x600000a01da8)
Member AddTitleMaster: 2006 -1 -1 (0x600000a017e8)
Member Fonts: -1 2016 -1 (0x600000a01a68)
Member IsFullyDownloaded: -1 2137 -1 (0x600000d395a8)
Member TitleMaster: -1 2004 -1 (0x600000a01768)
Member RemoteInvoke: 1610678275 -1 -1 (0x600000a01668)
Member SetUndoText: 2040 -1 -1 (0x600000a6b828)
Member SaveCopyAs: 2037 -1 -1 (0x600000a6b768)
Member Name: -1 2025 -1 (0x600000a01d28)
Member GetTypeInfo: 1610678273 -1 -1 (0x600000a01568)
Member DisableSections: 2092 -1 -1 (0x600000a6bd68)
Member FarEastLineBreakLevel: -1 2043 2043 (0x600000a6b8e8)
Member ColorSchemes: -1 2013 -1 (0x600000a019a8)
Member GetIDsOfNames: 1610678274 -1 -1 (0x600000a01628)
Member UpdateLinks: 2046 -1 -1 (0x600000a6b9a8)
Member Parent: -1 2002 -1 (0x600000a016e8)
Member Path: -1 2026 -1 (0x600000a01d68)
Member PageSetup: -1 2012 -1 (0x600000a01968)
Member VBProject: -1 2022 -1 (0x600000a01c68)
Member Designs: -1 2063 -1 (0x600000a6ba68)
Member Release: 1610612738 -1 -1 (0x600000a014a8)

@kev-is-coding-for-adn
Copy link
Author

kev-is-coding-for-adn commented Apr 15, 2025

So you mean it should work ?
Here is the code I tried to use to get this property for a presentation I know has the "auto save" property on.
But this code always return false.

public static bool IsAutoSaveOn(this Presentation pres)
        {
            try
            {
                return pres.Factory.ExecuteBoolPropertyGet(pres, "AutoSaveOn");
            }
            catch (Exception)
            {
                return false;
            }
        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants