How can get PPTX file page count in Uipath

How can get PPTX file page count in UiPath.I didn’t find any usefull activities.
Please help me !!~~

@cynbol

-You can use the “Invoke Code” activity to write a custom code snippet in VB.NET or C# to get the page count.
-Consider using external libraries, such as Open XML SDK, to work with Office files programmatically. You can write a custom script in VB.NET or C# and use it within the “Invoke Code” activity.

Cheers…!

Hi,
Install Balareva.EasyPowerpoint.Activities package from Manage packages
then use Powerpoint application scope activity
and use slide count activity inside scope
create output variable of slide count

Hi @cynbol

Try this code in Invoke Code activity:

' Check if the argument is not null
If Not String.IsNullOrEmpty(pptxPath) Then
    ' Your existing code here
    Using presentationDocument As DocumentFormat.OpenXml.Packaging.PresentationDocument = DocumentFormat.OpenXml.Packaging.PresentationDocument.Open(pptxPath, False)
        slidesCount= presentationDocument.PresentationPart.SlideParts.Count().ToString
        ' Now, 'slidesCount' contains the total number of slides/pages.
        ' You can use this value as needed in your workflow.
    End Using
Else
    ' Handle the case when the argument is not provided
    Throw New ArgumentException("File path is not provided.")
End If

Create the arguments this way.

This will give the count of slides.

Hope it helps!!