Help ! Converting pub files

Arlis Sturdy 15 Reputation points
2026-03-05T18:58:07.69+00:00

I have over 2000 pub files - what app is easiest to use to batch convert

You wouldn't just leave loyal (since 1995) users out to hang

Microsoft 365 and Office | Publisher | For home

5 answers

Sort by: Most helpful
  1. Kal-D 7,375 Reputation points Microsoft External Staff Moderator
    2026-03-29T22:22:07.3666667+00:00

    Hi Arlis Sturdy,

    Microsoft has confirmed that Publisher will no longer be supported after October 2026, so converting important .pub files now is a sensible step to ensure they remain usable long‑term for viewing, printing, and sharing.

    For a large library like yours, the practical options are:

    Best option overall (bulk conversion)

    Use Microsoft’s free PowerShell script (Convert‑PubFileToPDF.ps1). This script is designed specifically for bulk scenarios like this. It can scan a folder (including subfolders) and convert large numbers of .pub files to PDF with far less manual effort. Publisher still needs to be installed on the machine, but the script handles most of the repetitive work.

    You don’t need to be a PowerShell expert to use Microsoft’s conversion script. It’s already written and provided by Microsoft, and in most cases you simply point it at a folder containing your .pub files and let it run. You’re not writing code from scratch, and Publisher itself is still used for the conversion, which helps preserve layout and formatting.

    The script is designed for large collections and can process many files at once, including those in subfolders. It also continues running if a few files fail, making it far more practical than opening each publication manually. Microsoft specifically recommends this approach as the supported way to bulk‑convert Publisher files ahead of its retirement in October 2026.

    For reference: Microsoft Publisher will no longer be supported after October 2026

    If you do not want to use PowerShell

    The alternative is to open each file in Publisher and export it to PDF manually. This is usually only practical for a small number of files, not thousands.

    This approach generally works very well and usually preserves the layout, fonts, and graphics accurately. However, with more than 2,000 .pub files, doing this one by one would be extremely time‑consuming and could take many hours of repetitive work.

    Best format to preserve appearance

    PDF is the most reliable format for preserving the original layout and design and is what Microsoft recommends for long‑term access.

    Fully editable bulk migration

    Unfortunately, there is no simple Microsoft tool that can bulk‑convert .pub files into fully editable Word documents while keeping complex layouts intact. Content can often be reused later, but some reformatting is typically required.

    For 2,000+ files, starting with Microsoft’s free PowerShell script is the most practical and supported bulk option. If the main goal is reliable long‑term access, PDF is the best target format.

    If anything is unclear or you need assistance as you work through the conversion, feel free to let me know and we can take a look.

    I'm looking forward to your reply.


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

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?

    10+ people found this answer helpful.

  2. AI answer

    2026-03-05T18:58:20.5+00:00

    The easiest supported way to batch-convert a large number of .pub files is to use the provided PowerShell automation script together with an installed, licensed copy of Microsoft Publisher.

    Steps:

    1. Ensure Publisher is installed
      • Install and activate a working, licensed version of Microsoft Publisher on the machine that will run the conversion.
    2. Download the sample PowerShell script
      • Download the sample script Convert-PubFileToPDF.ps1 from the article “Microsoft Publisher will no longer be supported after October 2026” (see reference below under Example conversion script).
    3. Adjust the script if needed
      • Open the script in a text editor (such as Visual Studio Code or Notepad).
      • Optionally modify output folder, file naming, or export options as needed. The script uses Publisher’s Document.ExportAsFixedFormat API; you can adjust parameters such as PbFixedFormatType and PbFixedFormatIntent, or switch to Document.SaveAs with PbFileFormat if you want other formats.
    4. Open PowerShell with appropriate execution policy
      • Open Windows PowerShell as an administrator.
      • Ensure execution policies allow running local scripts (see the execution policies link in the same article for details). Adjust only as needed and according to your organization’s security policies.
    5. Run bulk conversions
      • Place Convert-PubFileToPDF.ps1 in a folder that’s easy to access.
      • Use one of these examples (replace paths with your own):
      • Convert a single file:
             .\Convert-PubFileToPDF.ps1 -Filter "C:\\Documents\\MyFile.pub"
        
      • Convert all .pub files in the current folder:
             .\Convert-PubFileToPDF.ps1 -Filter "*.pub"
        
      • Convert all .pub files in the current folder and subfolders:
             .\Convert-PubFileToPDF.ps1 -Filter "*.pub" -Recurse
        
      • Convert all .pub files in a specific folder:
             .\Convert-PubFileToPDF.ps1 -Filter "C:\\Documents\\*.pub"
        
      • Convert all .pub files in a specific folder and its subfolders:
             .\Convert-PubFileToPDF.ps1 -Filter "C:\\Documents\\*.pub" -Recurse
        
    6. Notes and behavior
      • The script is designed to continue running even if some files fail and will report which files succeeded and which encountered errors.
      • If a PDF with the same name already exists in the target location, that file will not be overwritten; an error will be shown. Rename or remove the conflicting file and rerun the script if needed.

    This approach lets thousands of Publisher files be converted in bulk without opening each one manually.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

    3 people found this answer helpful.
  3. Roadfan 0 Reputation points
    2026-08-23T23:13:52.7966667+00:00

    I faced a similar situation, needing to convert over 500 files made in Publisher to PDF before the October deadline.

    What I did was download a tool called "Pub to PDF" developed by a Ryan Mosberger. This small zipped up executable app enabled me to convert an entire folder of Publisher files with a single click. You have to have a licensed version of Publisher available on your system as it processes through it. It converted everything within five minutes or so.

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments

  4. Andy 0 Reputation points
    2026-08-31T23:57:52.7866667+00:00

    Arlis — you asked for easy, twice, and what came back was PowerShell. Arcata Presbyterian's comment above is the honest verdict on that: six hours and "some serious battles with my computer's file structure", from someone who says they have coding familiarity.

    The reason everyone points at that script is sound, though. It works by driving Publisher itself, so Publisher renders its own files and the PDFs come out exactly right. Nothing that reads .pub from the outside matches that fidelity.

    So I wrote something that does the same job as a double-click. Same method underneath — it opens each file in your installed copy of Publisher and exports via ExportAsFixedFormat — but with no execution policy to change, no working directory to get right, and no script path to find. You pick a folder, it walks the sub-folders, and writes a PDF for every .pub file into a new PDF-Backup folder, alongside a CSV log of what worked and what didn't.

    Two things matter at 2,000 files: it opens your originals read-only so they're never modified, and it skips anything it has already converted. So if it stops on a damaged file, you move that one aside and run it again rather than starting over.

    https://pubfilerescue.com

    Free, no sign-up, nothing uploaded anywhere. There's a .bas macro version in the same download for machines where IT blocks script files, which is often the situation in a church or school office.

    I wrote it, so treat that as disclosed. Whichever route you take, do it before 1 October — every one of these depends on Publisher still being installed.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

  5. koneill2021 0 Reputation points
    2026-08-21T04:54:30.07+00:00

    So my wife as well has years and years and hundreds of Publisher files. But just so happens I'm an M365 Engineer so I was able to take the Microsoft example script where they are converting .pub to .pdf and add to it the ability to also convert to .rtf and .docx. It's a bit crude but it worked and was a interesting 4 hr. project this evening. Script is here:

    <#

    Convert-PubFileToRTFModal.ps1

    .SYNOPSIS

    Converts .pub → .pdf (Publisher) → .rtf + .docx (Word)
    
    with automatic Publisher kill‑and‑restart when modal dialogs appear.
    

    .DESCRIPTION

    This version:
    
      • Removes ALL UIAutomation dialog handling
    
      • Detects modal dialog COM lock
    
      • Kills Publisher immediately when locked
    
      • Restarts Publisher for each retry
    
      • Retries each file once
    
      • Skips files that remain locked
    

    .EXAMPLES

      Run with the following filters from PowerShell Command Line:
    
    If needed set proper execution policies:
    
    Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
    

    .EXAMPLE

    ./Convert-PubFileToRTFModal.ps1 -Filter "C:\Documents\MyFile.pub"
    
    Converts the specified Publisher file to PDF to RTF to WORD format.
    

    .EXAMPLE

    ./Convert-PubFileToRTFModal.ps1 -Filter "*.pub"
    
    Converts all Publisher files in the current directory to PDF to RTF to WORD format.
    

    .EXAMPLE

    ./Convert-PubFileToRTFModal.ps1 -Filter "*.pub" -Recurse
    
    Converts all Publisher files in the current directory and all subdirectories to PDF to RTF to WORD format.
    

    KMO 8/20/2026 used Microsoft .PUB to .PDF version as base:

    https://download.microsoft.com/download/3e67cd40-2334-4c46-a0c9-30bd43eebb3c/Convert-PubFileToPDF.ps1

    Script was only utilized with Windows 11 Home Edition

    #>

    param(

    [Parameter(Mandatory=$true)]
    
    [string]$Filter,
    
    [switch]$Recurse
    

    )

    function Kill-Publisher {

    Write-Warning "Killing all Publisher processes..."
    
    Get-Process -Name "MSPUB" -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue
    
    Start-Sleep -Seconds 1
    

    }

    function Start-Publisher {

    try { return (New-Object -ComObject Publisher.Application) }
    
    catch {
    
        Write-Warning "Publisher cannot start."
    
        return $null
    
    }
    

    }

    function Start-Word {

    try { return (New-Object -ComObject Word.Application) }
    
    catch {
    
        Write-Warning "Word cannot start."
    
        return $null
    
    }
    

    }

    function Export-PubToPdf {

    param(
    
        [string]$PubPath,
    
        [string]$PdfPath
    
    )
    
    $app = Start-Publisher
    
    if (-not $app) { return $false }
    
    try {
    
        $doc = $app.Open($PubPath)
    
    }
    
    catch {
    
        Write-Warning "Open() failed for: $PubPath  -> $_"
    
        Kill-Publisher
    
        return $false
    
    }
    
    if (-not $doc) {
    
        Write-Warning "Publisher returned null document: $PubPath"
    
        Kill-Publisher
    
        return $false
    
    }
    
    try {
    
        $doc.ExportAsFixedFormat(
    
            [Microsoft.Office.Interop.Publisher.PbFixedFormatType]::pbFixedFormatTypePDF,
    
            $PdfPath
    
        )
    
        Write-Output "Saved PDF: $PdfPath"
    
    }
    
    catch {
    
        Write-Warning "PDF export failed for: $PubPath  -> $_"
    
        Kill-Publisher
    
        return $false
    
    }
    
    try { $doc.Close() } catch { Kill-Publisher }
    
    try { $app.Quit() } catch { Kill-Publisher }
    
    return $true
    

    }

    function Convert-PdfToRtfDocx {

    param(
    
        [string]$PdfPath,
    
        [string]$RtfPath,
    
        [string]$DocxPath
    
    )
    
    if (-not (Test-Path $PdfPath)) {
    
        Write-Warning "PDF not found for Word conversion: $PdfPath"
    
        return $false
    
    }
    
    $word = Start-Word
    
    if (-not $word) { return $false }
    
    $word.Visible = $false
    
    try {
    
        $doc = $word.Documents.Open($PdfPath)
    
    }
    
    catch {
    
        Write-Warning "Word cannot open PDF: $PdfPath  -> $_"
    
        try { $word.Quit() } catch {}
    
        return $false
    
    }
    
    if (-not $doc) {
    
        Write-Warning "Word returned null document for: $PdfPath"
    
        try { $word.Quit() } catch {}
    
        return $false
    
    }
    
    $ok = $true
    
    try {
    
        $doc.SaveAs([ref]$RtfPath, [ref][int][Microsoft.Office.Interop.Word.WdSaveFormat]::wdFormatRTF)
    
        Write-Output "Saved RTF: $RtfPath"
    
    }
    
    catch {
    
        Write-Warning "RTF save failed for: $PdfPath  -> $_"
    
        $ok = $false
    
    }
    
    try {
    
        $doc.SaveAs([ref]$DocxPath, [ref][int][Microsoft.Office.Interop.Word.WdSaveFormat]::wdFormatXMLDocument)
    
        Write-Output "Saved DOCX: $DocxPath"
    
    }
    
    catch {
    
        Write-Warning "DOCX save failed for: $PdfPath  -> $_"
    
        $ok = $false
    
    }
    
    try { $doc.Close() } catch {}
    
    try { $word.Quit() } catch {}
    
    return $ok
    

    }

    function Convert-OneFile {

    param([string]$PubPath)
    
    $base = [System.IO.Path]::Combine(
    
        [System.IO.Path]::GetDirectoryName($PubPath),
    
        [System.IO.Path]::GetFileNameWithoutExtension($PubPath)
    
    )
    
    $pdf  = "$base.pdf"
    
    $rtf  = "$base.rtf"
    
    $docx = "$base.docx"
    
    Write-Output "Converting: $PubPath"
    
    # --- FIRST ATTEMPT ---
    
    if (Export-PubToPdf -PubPath $PubPath -PdfPath $pdf) {
    
        if (Convert-PdfToRtfDocx -PdfPath $pdf -RtfPath $rtf -DocxPath $docx) {
    
            return $true
    
        }
    
    }
    
    Write-Warning "First attempt failed. Retrying with clean Publisher restart..."
    
    Kill-Publisher
    
    # --- SECOND ATTEMPT ---
    
    if (Export-PubToPdf -PubPath $PubPath -PdfPath $pdf) {
    
        if (Convert-PdfToRtfDocx -PdfPath $pdf -RtfPath $rtf -DocxPath $docx) {
    
            return $true
    
        }
    
    }
    
    Write-Warning "Skipping file (Publisher remained locked): $PubPath"
    
    return $false
    

    }

    Validate filter

    if (-not ($Filter -like "*.pub")) {

    Write-Warning "Filter must specify .pub files."
    
    exit 1
    

    }

    $files = Get-ChildItem -File -Recurse:$Recurse -Filter $Filter

    if (-not $files) {

    Write-Warning "No .pub files found."
    
    exit 1
    

    }

    $success = 0

    $fail = 0

    foreach ($file in $files) {

    if (Convert-OneFile -PubPath $file.FullName) { $success++ }
    
    else { $fail++ }
    

    }

    Write-Output "Completed: $success succeeded, $fail failed."

    Was this answer helpful?

    1 person found this answer helpful.

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.