web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details
Power Automate - Power Automate Desktop
Answered

How to convert PPTX to Image file (or) PPTX to PDF using VB script or other scripts

Like (0) ShareShare
ReportReport
Posted on 28 Nov 2021 11:58:06 by

  Requirements:      

            In desktop flow itself I need to convert PPTX file to image or pdf file format. Please help me to solve this problem

  • Verified answer
    Highboy Profile Picture
    1,183 Super User 2024 Season 1 on 28 Nov 2021 at 19:22:44
    Re: How to convert PPTX to Image file (or) PPTX to PDF using VB script or other scripts

    One way to do it is to create a seperate flow with two input variables.
    In my example there are two input variables called pptxdoc and pdfdoc.

    I called the standalone flow pptxtopdf and it contains one call to powershell

    ---------- Paste below into a new flow, create the two input variables and save it----------

    Scripting.RunPowershellScript Script: $'''$powerpnt = New-Object -ComObject PowerPoint.Application
    $doc = \"%PPTXDoc%\"
    $saveaspath = \"%pdfdoc%\"
    $openDoc = $powerpnt.Presentations.Open($doc,[Microsoft.Office.Core.MsoTriState]::msoFalse,[Microsoft.Office.Core.MsoTriState]::msoFalse,[Microsoft.Office.Core.MsoTriState]::msoFalse)
    $openDoc.SaveAs($saveaspath , [Microsoft.Office.Interop.PowerPoint.PpSaveAsFileType]::ppSaveAsPDF,[Microsoft.Office.Core.MsoTriState]::msoFalse)
    $openDoc.Close()
    $powerpnt.Quit()''' ScriptOutput=> PowershellOutput ScriptError=> ScriptError

    ---------- Do NOT paste this line and the text below into pad ----------

    Now you have a way to convert pptx files into pdf by calling the desktop flow you just saved, with two parameters (And you can reuse it in all your scripts, in the future) 

    Highboy_0-1638127278588.png

     

Helpful resources

Quick Links

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 2

Loading complete