How to mass convert Publisher files to some other usable format?

Roger Glidewell 0 Reputation points
2026-10-25T21:58:26.72+00:00

Hello,

I am a 76-year old teacher who has used Microsoft Publisher for decades. I have hundreds of files, and I have been trying to convert them, but this has been very tedious. Now I understand that I could possibly convert a lot of files at one time to pdf format and then to Word?

Can you help me with this process? I do not want to lose decades of hard work, it would be so excruciatingly difficult.

Thank you

Microsoft 365 and Office | Publisher | For education
0 comments No comments

3 answers

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  2. Jack-Bu 7,220 Reputation points Microsoft External Staff Moderator
    2026-10-25T22:32:03.57+00:00

    Hi Roger,

    You can use a PowerShell script to help bulk-convert your Publisher files to PDF, which can significantly reduce the effort required when working with a large number of publications.

    Please note that after October 1, 2026, Microsoft Publisher is no longer supported, and you may no longer be able to open or edit Publisher files using Microsoft 365 apps. To run the conversion script, you'll need access to a standalone version of Publisher that remains installed on your device, such as Publisher 2021 or another perpetual-license edition that includes Publisher.

    Before proceeding, it's also recommended that you create a backup of all your original .pub files so that you retain the source documents after the conversion process.

    • Go to C:\ and create a new folder named PubConvert > copy the downloaded file (named Convert-PubFileToPDF.ps1) into this folder
    • Then put all your .pub files into a single folder
    • After that, open Windows PowerShell and follow this instruction:

    For reference: Help Converting Publisher Files To PDFs - Microsoft Q&A

    <#
    .SYNOPSIS
    	Converts Microsoft Publisher .pub files to PDF format.
    .DESCRIPTION
    	This script automates the conversion of Microsoft Publisher (.pub) files to PDF format using the Microsoft Office Interop Publisher library.
    	It processes all files matching the specified filter, checks if a PDF already exists for each file, and skips conversion if the PDF is present.
    	The script logs successful conversions and any errors encountered during the process.
        Updated to fully support Windows Long Paths (>260 characters) and wildcard filters.
    .PARAMETER Filter
    	Specifies the file filter to select Publisher files for conversion.
    	This can be a specific file name (e.g., "document.pub") or a wildcard pattern (e.g., "*.pub").
    .PARAMETER Recurse
    	If specified, searches for Publisher files recursively in all subdirectories that match the filter. If omitted, only the current directory is searched.
    #>
    param
    (
    	[ValidateNotNullOrEmpty()]
    	[string]
    	$Filter,
    	[switch]
    	$Recurse
    )
    if (-not $PSBoundParameters.ContainsKey('Filter')) {
    	Write-Error "The -Filter parameter is required."
    	exit 1
    }
    if (-not ($Filter -like "*.pub")) {
    	Write-Error "The filter must specify .pub files (e.g., '*.pub' or 'file.pub').";
    	exit 1;
    }
    try {
    	# Safely determine the search directory and file pattern without letting GetFullPath choke on wildcards
    	$resolvedFilter = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($Filter)
    	if ([System.IO.Directory]::Exists($resolvedFilter)) {
    		$searchDir = $resolvedFilter
    		$searchPattern = "*.pub"
    	} else {
    		# Split the path into directory and file pattern parts safely
    		$searchDir = [System.IO.Path]::GetDirectoryName($resolvedFilter)
    		$searchPattern = [System.IO.Path]::GetFileName($resolvedFilter)
    		# If the directory part still contains wildcards, strip them to find the base path
    		if ($searchDir -like "*[*?]*") {
    			Write-Error "Wildcards are only supported in the filename/extension part of the filter, not in folder names."
    			exit 1
    		}
    	}
    	if (-not [System.IO.Directory]::Exists($searchDir)) {
    		Write-Error "The directory does not exist: $searchDir"
    		exit 1
    	}
    	# Use modern dotnet enumeration which natively ignores the 260 character path limit
    	$searchOption = if ($Recurse) { [System.IO.SearchOption]::AllDirectories } else { [System.IO.SearchOption]::TopDirectoryOnly }
    	try {
    		$rawFiles = [System.IO.Directory]::EnumerateFiles($searchDir, $searchPattern, $searchOption)
    		$files = @()
    		foreach ($f in $rawFiles) {
    			$files += New-Object System.IO.FileInfo($f)
    		}
    	} catch {
    		Write-Error "Error finding files: $_"
    		exit 1
    	}
    	if ($files.Count -eq 0) {
    		Write-Error "No Publisher files found for the filter: $Filter";
    		exit 1;
    	}
    	Write-Output "Running...";
    	Add-type -AssemblyName Office;
    	Add-type -AssemblyName Microsoft.Office.Interop.Publisher;
    	try {
    		$app = New-Object -ComObject Publisher.Application;
    	} catch {
    		Write-Error "Microsoft Publisher is not installed or accessible.";
    		exit 1;
    	}
    	$successCount = 0;
    	$failCount = 0;
    	foreach ($file in $files) {
    		if ($file.Extension -eq ".pub") {
    			$fileFullName = $file.FullName;
    			# Prepend long path escape prefix if the path length exceeds standard limits
    			if ($fileFullName.Length -ge 240 -and -not $fileFullName.StartsWith("\\?\")) {
    				if ($fileFullName.StartsWith("\\")) {
    					# Network UNC paths
    					$fileFullName = "\\?\UNC\" + $fileFullName.Substring(2)
    				} else {
    					# Local drive paths
    					$fileFullName = "\\?\" + $fileFullName
    				}
    			}
    			$pdfFilePath = [System.IO.Path]::ChangeExtension($fileFullName, '.pdf')
    			# Use dotnet's Exists check to circumvent standard Test-Path path length limitations
    			if ([System.IO.File]::Exists($pdfFilePath)) {
    				Write-Error "PDF file already exists: $pdfFilePath";
    				$failCount++;
    				Continue;
    			}
    			# Open the file
    			try {
    				$doc = $app.Open($fileFullName);
    			} catch {
    				$failCount++;
    				Write-Error "Error opening file: $fileFullName $_";
    				Continue;
    			}
    			if (-not($doc)) {
    				$failCount++;
    				Write-Error "Failed to open file: $fileFullName";
    				Continue;
    			}
    			try {
    				# Export file as PDF
    				$doc.ExportAsFixedFormat([Microsoft.Office.Interop.Publisher.PbFixedFormatType]::pbFixedFormatTypePDF, $pdfFilePath);
    				if ([System.IO.File]::Exists($pdfFilePath)) {
    					Write-Output "Exported to $pdfFilePath.";
    					$successCount++;
    				} else {
    					$failCount++;
    					Write-Error "Failed to export file: $fileFullName";
    				}
    			} catch {
    				$failCount++;
    				Write-Error "Error during export: $_";
    			}
    			$doc.Close();
    		}
    	}
    	#Log output
    	Write-Output "Converted $successCount files with $failCount errors.";
    }catch{
    	Write-Error $_;
    }finally {
    	if ($app) {
    		#Quit Publisher
    		$app.Quit();
    	}
    }
    

    If you do not have a version of Publisher installed on your device, you will need to use a third-party conversion tool or service to convert your .pub files. Please note that Microsoft does not provide or support third-party conversion tools, and the quality and accuracy of the conversion may vary depending on the complexity of the publication. Before using any third-party solution, it is recommended that you back up your original Publisher files and review your organization's security and privacy requirements, especially if files will be uploaded to an online service.

    If you have any questions or need further assistance, please feel free to share them in the comments on this post.


    If the answer is helpful, please click 'Yes' and kindly upvote it.

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

    Was this answer helpful?


  3. AI answer

    2026-10-25T21:59:05.2966667+00:00

    Use Microsoft’s PowerShell conversion script to export copies of all your Publisher files to PDF, while keeping every original .pub file as the safest master copy.

    1. Protect the originals first

    1. Copy all folders containing Publisher files to an external drive or another safe location.
    2. Do not delete the .pub files after conversion.
    3. Start by testing the process on a copied folder containing five to ten publications.
    4. Open the resulting PDFs and compare every page with the originals before processing the full collection.

    PDF is the best preservation format because it retains the publication’s appearance and printing layout. Word is better for editing text, but its layout may differ from Publisher—especially with graphics, columns, frames, page borders, or complex designs.^1^

    2. Find all Publisher files

    In Windows File Explorer, search your Documents, OneDrive, and other storage folders for:

    *.pub
    

    Place the files under one main folder if practical—for example, C:\PublisherFiles—while retaining their existing subfolders. Microsoft also recommends searching for .pub files on your PC, OneDrive, or SharePoint.^1^

    3. Bulk-convert the files to PDF

    This procedure requires a working, licensed copy of Publisher on the Windows computer.

    1. Download Microsoft’s sample conversion script.
    2. Save it in the folder containing the copied Publisher files.
    3. Right-click Start, open Windows PowerShell or Terminal, and change to that folder. For example:
    cd "C:\PublisherFiles"
    
    1. First, test one file:
    .\Convert-PubFileToPDF.ps1 -Filter "C:\PublisherFiles\Test.pub"
    
    1. If the test PDF is correct, convert every .pub file in that folder and its subfolders:
    .\Convert-PubFileToPDF.ps1 -Filter "*.pub" -Recurse
    

    Microsoft documents this script for individual or bulk PDF export. It continues after an error and reports which files succeeded or failed. If a PDF with the same name already exists, the script will not overwrite it; rename or move that PDF before trying the affected file again.^1^

    If PowerShell says scripts are disabled, use Microsoft’s linked execution-policy instructions from the retirement page rather than changing security settings without assistance.

    4. Convert only files that need editing to Word

    There is no need to convert every PDF to Word. Keep PDFs for viewing, printing, and archiving; convert selected documents only when their text must be edited.

    For each needed PDF:

    1. Open the Word desktop application.
    2. Select File > Open > Browse.
    3. Select the PDF.
    4. When Word says it will convert the PDF, select OK.
    5. Review the document carefully, then select File > Save As and save it as a Word document.

    Word creates a converted copy and leaves the original PDF unchanged. Conversion works best with publications that are mostly text. Graphic-heavy pages may become images, and items such as frames, page borders, tables, and font effects may not convert faithfully.^2^

    Important timing

    Publisher for Microsoft 365 remains usable until the October 2026 retirement. Microsoft 365 subscribers will then lose access to Publisher; perpetual editions can continue to be installed and used, although support ends. Complete the PDF export while the licensed Publisher installation still works.^1^

    Keep three sets if storage permits:

    • Original .pub files
    • Preservation .pdf files
    • Selected editable .docx files

    References

    1. Microsoft Publisher will no longer be supported after October 2026 | Microsoft Support
    2. Opening PDFs in Word | Microsoft Support
    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was 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.