We had implemented code for PPT locked and works with office 2013 as per desired.
Unfortunately, it doesn’t work wtih office 2016 at all. Any object of slides are not locked.
Please provide few suggestion for the same.
It is urgent.
Regards,
Ritesh Kothari
Hi Ritesh,
private void LockSlide(Presentation destPres)
{
ISlide slide1 = destPres.Slides[0];
for (int slideCount = 0; slideCount < destPres.Slides.Count; slideCount++)
{
slide1 = destPres.Slides[slideCount];
IShape shape;
//Travesing through all the shapes in the slides
for (int count = 0; count < slide1.Shapes.Count; count++)
{
shape = slide1.Shapes[count];
//if shape is autoshape
if (shape is IAutoShape)
{
//Type casting to Auto shape and getting auto shape lock
IAutoShape Ashp = shape as IAutoShape;
IAutoShapeLock AutoShapeLock = Ashp.ShapeLock;
//Applying shapes locks
AutoShapeLock.PositionLocked = true;
AutoShapeLock.SelectLocked = true;
AutoShapeLock.SizeLocked = true;
}
//if shape is group shape
else if (shape is IGroupShape)
{
//Type casting to group shape and getting group shape lock
IGroupShape Group = shape as IGroupShape;
IGroupShapeLock groupShapeLock = Group.ShapeLock;
//Applying shapes locks
groupShapeLock.GroupingLocked = true;
groupShapeLock.PositionLocked = true;
groupShapeLock.SelectLocked = true;
groupShapeLock.SizeLocked = true;
}
//if shape is a connector
else if (shape is IConnector)
{
//Type casting to connector shape and getting connector shape lock
IConnector Conn = shape as IConnector;
IConnectorLock ConnLock = Conn.ShapeLock;
//Applying shapes locks
ConnLock.PositionMove = true;
ConnLock.SelectLocked = true;
ConnLock.SizeLocked = true;
}
//if shape is picture frame
else if (shape is IPictureFrame)
{
//Type casting to pitcture frame shape and getting picture frame shape lock
IPictureFrame Pic = shape as IPictureFrame;
IPictureFrameLock PicLock = Pic.ShapeLock;
//Applying shapes locks
PicLock.PositionLocked = true;
PicLock.SelectLocked = true;
PicLock.SizeLocked = true;
}
}
}
}
Hi Ritesh,
I opened the attached file. It is not locked. I can change the content.
please find attached screenshot.
Thanks.
Hi Adnan -
One nuance I wanted to bring to your attention after reviewing your locked PPT example. It seems that shapes are locked but content/text within the shapes isn’t. I can edit/delete without any issues. You can check “test” which you have within the rectangle, I can easily edit that which shouldn’t be the case once the PPT is locked in 2016.
Thanks,
Ritesh
Hi Adnan -
Any updates on the issue?
Thanks!
Hi Ritesh,
Hi Ritesh,
Hi Adnan,
As per your previous comment, you observed locked file issue with Office 2016 for Aspose.Slides for .NET 16.7.0.
Have your team test with same version Aspose.Slides?
Currently we faced the locked presentation issue with Office 2016 (Version: 16.0.6868.2062).
Thanks
Hi Ritesh,
The issues you have found earlier (filed as SLIDESNET-37833) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
Hello,
We have integrated new dll (ver. 16.11.0) with existing project.
Unfortunately, Issue is still not fixed. I faced same problem with office 2016.
Thanks.
Hi Ritesh,
Hello,
Thanks for providing code snippet for locked presentation. It works with office professional version of office 2016.
Unfortunately, it doesn’t work with Microsoft Office 365 ProPlus version. Please look into that. Here I attached screenshot of office version where this code doesn’t work.
Thanks.
Hi Ritesh,
I have shared the information with our product team regarding Office 365 ProPlus version We will get back to you with a feedback as soon as it will be shared by our product team.
Many Thanks,
Hi Ritesh,
Please try to update your Office. and also try to add code:
…
blockerShape.AutoShapeLock.TextLocked = true;
…
The issues you have found earlier (filed as SLIDESNET-37833) have been fixed in Aspose.Slides for .NET 18.1. Please try using the latest release version and in case you experience any issue or you have any further query, please feel free to contact.