how to know which slides get modified by the user during presentation open and save in VSTO powerpoint c#

被刻印的时光 ゝ 提交于 2021-01-29 07:24:07

问题


On the BeforeSave event, I want to check that which slides get modified by the user. Technically I want to check that what was the state of slide when it opened and what is the state on saving, so I will get any acknowledgement for which slides are modified.

private void Application_PresentationBeforeSave(Presentation Pres, ref bool Cancel)
    {
        MessageBox.Show("before save event.....HITED");
    }

This event hits successfully. i want to check if slide is modified by user or not. I know possible ways as follows,

(1) on presentation open event convert all slide in to images => on before save event again convert all slide in to image then compare that images. but this is too lengthy and time consuming approach. so i cant use

(2) on presentation open event, get the every slide presentaionML and on before save get presentaionML then compare those string. this is also unreliable process. i tried it. zip PPT then unzip it, it will show folder structure..slide folder is there which contain all slides xml in separate file.but this xml files not containing any slide ID or something(unique identifier) so we can not confidently compare with another destination slide.xml file. (if user change the seq of slide or delete slide then this scenario will fail)

(3) i tried third approach like, on file open event make a copy of PPT file, then before save event access that copied PPT and each slide object will be compare with current active PPT slide object by using

bool flag =obj1.Equals(obj2); 

but this always return false. because obj1 family member of active presentation. and obj2 is member of non Active Presentation(because that we opened pragmatically ). so it is returning false even if slides are same on both side.

is any inbuilt method for this. like which will give the list of slide that have been modified after opening.......?

any one have any other approach to solve this .....?

i am working in VSTO c# PowerPoint. .net framework 4.5

来源:https://stackoverflow.com/questions/54288513/how-to-know-which-slides-get-modified-by-the-user-during-presentation-open-and-s

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!