none
Power Point - find if slide was changed RRS feed

  • Question

  • Hi,

    As part of my power point add-in i need to check if some slide was changed after it was opened in the power point.

    Scenario is something like:

    - open presentation

    -work on that presentation

    -save presentation

    On save i need to check what are the slides that are changed and upload those slides somewhere.

    My approach was to generate a image from slide in the original presentation and generate image when user click save and compare those images. I have some issues with this: performance is not the best, and if slide have slide number i am not always able to remove the slide number (if slide is just moved to new position image would be different). Also changes in the notes would not be recognized if we just compare images.

    Now, I am trying to see if presentation merge function can help here. I see that power point is able to note changes after merge, but i am not sure how i can get those infos in the code.

    Does anyone have some idea about this?

    What is the best way to compare if two slides are same?

    How can i get the slide changes info after merge?

    Thanks

    Thursday, July 16, 2015 6:42 AM

Answers

  • Hi Goce,

    >> For now i dont see a way to recognize if some element represents slide number.

    I am afraid that we could not get the slideNumber in the shape with Object Model. I insert SlideNumber into shape, and then I look into the Shape Object Model. The SlideNumber is stored as String. Even though, after we change the order of the slide, the SlideNumber would change, but it seems that at present, PowerPoint do not provide such property for us to check whether the Number is common number or a SlideNumber.

    I use Open XML SDK tool to reflect the file, found the SlideNumber in the file is stored as field, and it is in the “<a:fld” element. I think you could remove the SildeNumber with OpenXml. The code bellow shows a simple demo to get the field and remove it.

            private  void ChangeSlidePart1(SlidePart slidePart1)
            {
                Slide slide1 = slidePart1.Slide;
    
                CommonSlideData commonSlideData1=slide1.GetFirstChild<CommonSlideData>();
    
                ShapeTree shapeTree1=commonSlideData1.GetFirstChild<ShapeTree>();
    
                Shape shape1=shapeTree1.GetFirstChild<Shape>();
    
                TextBody textBody1=shape1.GetFirstChild<TextBody>();
    
                A.Paragraph paragraph1=textBody1.GetFirstChild<A.Paragraph>();
    
                A.Field field1=paragraph1.GetFirstChild<A.Field>();
    
                field1.Remove();
            }
    

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    • Marked as answer by Goce Stojcev Saturday, August 1, 2015 7:13 AM
    Monday, July 27, 2015 11:49 AM

All replies

  • Hi Goce,

    >> I am trying to see if presentation merge function can help here. I see that power point is able to note changes after merge, but i am not sure how i can get those infos in the code.

    Yes, with merge function, we could note changes after merge. But I looked into PowerPoint Object Model, and failed to find such object to get those infos. In Word, we could get Revisions Object, but in PowerPoint, it seems that there is no such an object. I am afraid that we could not achieve your requirement with Merge function. If this is a feature you want to include in future versions of PowerPoint, please submit a feedback as picture below:

    In my option, if you want to compare two slides, I think you need to compare all of the details which you want via retrieve PowerPoint object model.

    # Slide Properties (PowerPoint)
    https://msdn.microsoft.com/EN-US/library/office/jj228697.aspx

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Monday, July 20, 2015 9:00 AM
  • Hi Edward,

    Thank you very much for your replay.

    Since we cant use the merge for now, do you know for some method that can hide or remove slide numbers?

    As i see, we can remove slide number on presentation or slide level, but only from header-footer part.

    Is it possible to search all shapes in the slide and recognize if shape has slide number in it?

    Thanks again

    Monday, July 20, 2015 1:31 PM
  • Hi Goce,

    As you know, we could remove slide number from header-footer part on slide level. Actually, the slide number did not remove, it just hide.

    >> Is it possible to search all shapes in the slide and recognize if shape has slide number in it?

    Do you mean the slide number in different shapes? In my option, the slide number is in HeadersFooters object, and it is in the lower-right corner of a slide, or in the lower right corner of page depends on the theme.

    If you want to check the content of the slide whether the slide number is visible or not and hide it. You could check the “HeadersFooters.SlideNumber.Visible” and set the Visible property.
    Something like below:

    Sub test()
       Debug.Print ActivePresentation.Slides(1).HeadersFooters.SlideNumber.Visible
       ActivePresentation.Slides(1).HeadersFooters.SlideNumber.Visible = msoFalse
    End Sub

    # HeadersFooters.SlideNumber Property (PowerPoint)
    https://msdn.microsoft.com/en-us/library/office/ff746240.aspx

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Friday, July 24, 2015 10:05 AM
  • Hi Edward,

    I know that SlideNumber object is available in HeadersFooters, but i think that it does not recognize all the slide number fields that can exist in the slide. I have some presentations where slide number is inserted in the shape.paragraph, and this SlideNumber.Visible property will not affect those.

    That is why i am thinking about finding all the elements in the slide and remove or hide the elements that represent slideNumber.

    For now i dont see a way to recognize if some element represents slide number.

    Let me know if you think that sending some presentation where this can be reproduced would help.

    Thanks again,

    Goce

    Friday, July 24, 2015 12:35 PM
  • Hi Goce,

    >> For now i dont see a way to recognize if some element represents slide number.

    I am afraid that we could not get the slideNumber in the shape with Object Model. I insert SlideNumber into shape, and then I look into the Shape Object Model. The SlideNumber is stored as String. Even though, after we change the order of the slide, the SlideNumber would change, but it seems that at present, PowerPoint do not provide such property for us to check whether the Number is common number or a SlideNumber.

    I use Open XML SDK tool to reflect the file, found the SlideNumber in the file is stored as field, and it is in the “<a:fld” element. I think you could remove the SildeNumber with OpenXml. The code bellow shows a simple demo to get the field and remove it.

            private  void ChangeSlidePart1(SlidePart slidePart1)
            {
                Slide slide1 = slidePart1.Slide;
    
                CommonSlideData commonSlideData1=slide1.GetFirstChild<CommonSlideData>();
    
                ShapeTree shapeTree1=commonSlideData1.GetFirstChild<ShapeTree>();
    
                Shape shape1=shapeTree1.GetFirstChild<Shape>();
    
                TextBody textBody1=shape1.GetFirstChild<TextBody>();
    
                A.Paragraph paragraph1=textBody1.GetFirstChild<A.Paragraph>();
    
                A.Field field1=paragraph1.GetFirstChild<A.Field>();
    
                field1.Remove();
            }
    

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    • Marked as answer by Goce Stojcev Saturday, August 1, 2015 7:13 AM
    Monday, July 27, 2015 11:49 AM
  • Hi Edward,

    It looks like this can solve the issue for now.

    Thank you very much

    Thursday, July 30, 2015 7:07 PM