Convert .pub file to .pptx

Charles Pappas 0 Reputation points
2026-08-05T00:38:44.35+00:00

In OneDrive, do you have a tool to find all the .pub files and auto convert them to .ppt?

Microsoft 365 and Office | OneDrive | For business | Windows
0 comments No comments

3 answers

Sort by: Most helpful
  1. Mike Pittman 5 Reputation points
    2026-10-07T23:38:39.3866667+00:00

    You should look at https://github.com/dllmr/PUBtoPPT

    I automated this on Windows and converted over 9K files as per comments here https://github.com/dllmr/PUBtoPPT/issues/1

    The final comment there has the below script that needs to be saved to a .bat file only in order to allow it to be double-clicked in Windows File Explorer. It actually mostly runs in PowerShell and just provides batch and recursive abilities to the python file from the github link above.


    @echo off
    title PUB to PPTX Batch Converter
    powershell -NoExit -ExecutionPolicy Bypass -Command ^
        "$recursive = $true;" ^
        "Write-Host 'Scan all subdirectories? [Y/n] (Auto-selecting Yes in 30 seconds...): ' -NoNewline -ForegroundColor Yellow;" ^
        "$secondsLeft = 30;" ^
        "while ($secondsLeft -gt 0) {" ^
        "    if ([Console]::KeyAvailable) {" ^
        "        $key = [Console]::ReadKey($true);" ^
        "        if ($key.Key -eq 'Enter') { Write-Host 'Y (User selection)'; break };" ^
        "        $char = $key.KeyChar.ToString().ToLower();" ^
        "        if ($char -eq 'n') { $recursive = $false; Write-Host 'N (User selection)'; break };" ^
        "        if ($char -eq 'y') { $recursive = $true; Write-Host 'Y (User selection)'; break };" ^
        "    }" ^
        "    Start-Sleep -Milliseconds 200;" ^
        "    $secondsLeft -= 0.2;" ^
        "};" ^
        "if ($secondsLeft -le 0) { Write-Host 'Y (Timed out - default selected)' -ForegroundColor Gray };" ^
        "Write-Host '';" ^
        "$HOME_PATH = $env:USERPROFILE;" ^
        "$SCRIPT_DIR = Get-Location;" ^
        "if ($recursive) {" ^
        "    Write-Host 'Scanning current directory AND subdirectories for Microsoft Publisher (.pub) files...' -ForegroundColor Yellow;" ^
        "    $getFiles = { Get-ChildItem -Recurse -Filter *.pub -ErrorAction SilentlyContinue };" ^
        "} else {" ^
        "    Write-Host 'Scanning ONLY the current directory for Microsoft Publisher (.pub) files...' -ForegroundColor Yellow;" ^
        "    $getFiles = { Get-ChildItem -Filter *.pub -ErrorAction SilentlyContinue };" ^
        "}" ^
        "$pubFiles = @(); $scanCounter = 0;" ^
        "& $getFiles | ForEach-Object {" ^
        "    $scanCounter++; $pubFiles += $_;" ^
        "    Write-Progress -Activity 'Scanning for Publisher Files' -Status ('Found ' + $scanCounter + ' file(s) so far...') -CurrentOperation $_.FullName;" ^
        "};" ^
        "Write-Progress -Activity 'Scanning for Publisher Files' -Completed;" ^
        "$totalFiles = $pubFiles.Count; $currentIndex = 0;" ^
        "if ($totalFiles -eq 0) { Write-Host 'No Publisher (.pub) files were found.' -ForegroundColor Red; return };" ^
        "Write-Host ('Found ' + $totalFiles + ' Publisher file(s) ready to convert.`n') -ForegroundColor Green;" ^
        "foreach ($file in $pubFiles) {" ^
        "    $currentIndex++;" ^
        "    $filePath = $file.FullName;" ^
        "    $pptxPath = [System.IO.Path]::ChangeExtension($filePath, '.pptx');" ^
        "    $percent = [math]::Round(($currentIndex / $totalFiles) * 100);" ^
        "    Write-Progress -Activity 'Converting Publisher Files to PowerPoint' -Status ('Processing file ' + $currentIndex + ' of ' + $totalFiles + ' (' + $percent + '%%)') -CurrentOperation $file.Name -PercentComplete $percent;" ^
        "    if (Test-Path $pptxPath) {" ^
        "        Write-Host ('Skipping (Already converted): ' + $filePath) -ForegroundColor DarkGray;" ^
        "        continue;" ^
        "    }" ^
        "    Write-Host ('Processing [' + $currentIndex + '/' + $totalFiles + ']: ' + $filePath) -ForegroundColor Cyan;" ^
        "    $job = Start-Job -ScriptBlock {" ^
        "        param($path, $userHome, $scriptDir)" ^
        "        Set-Location $scriptDir;" ^
        "        $uvPath = Join-Path $userHome '.local\bin\uv.exe';" ^
        "        $pyScript = Join-Path $scriptDir 'pub2pptx.py';" ^
        "        & $uvPath run --system-certs $pyScript $path 2>&1;" ^
        "    } -ArgumentList $filePath, $HOME_PATH, $SCRIPT_DIR;" ^
        "    $completed = Wait-Job $job -Timeout 60;" ^
        "    if ($null -eq $completed) {" ^
        "        Write-Warning ('TIMED OUT (60s exceeded): ' + $filePath + ' - skipping file.');" ^
        "        Stop-Job $job;" ^
        "    } else {" ^
        "        $rawOutput = Receive-Job $job;" ^
        "        foreach ($item in $rawOutput) {" ^
        "            $line = $item.ToString().Trim();" ^
        "            if ([string]::IsNullOrWhiteSpace($line)) { continue }" ^
        "            if ($line -match '^(warning:)' -or $line -match 'skipping image|no pages found in document') {" ^
        "                Write-Host ('  [Conversion Warning] ' + $line) -ForegroundColor Yellow;" ^
        "            } elseif ($line -match '^(Installed|Resolved|Audited|Built|Prepared|Downloaded|Using Python|Creating virtualenv)') {" ^
        "                Write-Host ('  [Environment] ' + $line) -ForegroundColor DarkGray;" ^
        "            } elseif ($line -match '^(Traceback|ValueError|FileNotFoundError|PermissionError|error:)' -or $item -is [System.Management.Automation.ErrorRecord]) {" ^
        "                Write-Host ('  [Conversion Error] ' + $line) -ForegroundColor Red;" ^
        "            } else {" ^
        "                Write-Host ('  [Info] ' + $line) -ForegroundColor Gray;" ^
        "            }" ^
        "        }" ^
        "    }" ^
        "    Remove-Job $job -Force;" ^
        "};" ^
        "Write-Progress -Activity 'Converting Publisher Files to PowerPoint' -Completed;"
    echo.
    echo ========================================================
    echo Execution complete or stopped. Press any key to exit...
    echo ========================================================
    pause
    

    Was this answer helpful?

    1 person found this answer helpful.

  2. Elena-VH 2,130 Reputation points Independent Advisor
    2026-08-05T01:10:30.4266667+00:00

    Dear @Charles Pappas

    There isn't a native OneDrive feature that can automatically find all .pub (Microsoft Publisher) files and convert them to PowerPoint (.ppt/.pptx) files in bulk.

    Before October 2026, Microsoft recommends converting your .pub files to PDF so you can continue accessing and printing them in the future. This can be done directly inside Publisher using Save As > Select PDF.   

    If you have a large library of .pub files, Microsoft also provides an official PowerShell script that can batch‑convert them to PDF automatically, saving you from opening files one by one.  

    You can find more detail at: 

    Disclaimer: This link is shared by community members for your convenience. It points to a third-party site that is not managed or verified by Microsoft. We can’t guarantee the quality, safety, or suitability of any content or software found there. Please review carefully and make sure you understand any potential risks before using it.

    I hope this information is useful. Thank you again for your time and for raising this important usability concern. If you have any further questions or need additional assistance, please don’t hesitate to reach out. 

    I look forward to your thoughts on this. 


    If the answer is helpful, please click "Yes" and kindly upvote it. If you have extra questions about this answer, please click "Comment".   

    Note: Please follow the steps in the forum documentation to enable email notifications if you want to receive notifications related to this thread.    

    Was this answer helpful?

    1 person found this answer helpful.

  3. Marcin Policht 110K Reputation points MVP Volunteer Moderator
    2026-08-05T01:11:44.6566667+00:00

    Unfortunately no - OneDrive does not have a built-in tool to find .pub files and automatically convert them to .pptx. Microsoft Publisher files use a unique desktop publishing format that OneDrive cannot natively interpret or convert into PowerPoint presentations.

    The main reason direct conversion is not available is that neither Microsoft Office nor OneDrive provides an automated cloud-based feature to transform Publisher layouts into editable PowerPoint slides. In addition, Publisher is designed for fixed-page desktop publishing, whereas PowerPoint is based on a sequence of slides. Because of these fundamental differences, automatic conversion would require significant formatting and layout changes.

    If you need to convert Publisher files, you have a couple of alternatives. You can open each file in the Microsoft Publisher desktop application and export it as a PDF or images, which can then be imported into PowerPoint or another application. Microsoft also provides a PowerShell script to automate conversion of Publisher (.pub) files to PDF as part of its guidance for the retirement of Microsoft Publisher.

    Alternatively, you can use a third-party desktop conversion utility, such as Univik PUB Converter, to perform local format conversions in batches.


    If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

    hth

    Marcin

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.