Is there a macro for converting a batch of publisher files to word?

Diane Scott 0 Reputation points
2026-04-26T16:23:56.5933333+00:00

I want to convert a large number of publisher files to word. I am not the least bit proficient with macros. Has someone created a macro to convert a batch of files from publisher to word?

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

1 answer

Sort by: Newest
  1. Marcin Policht 109.8K Reputation points MVP Volunteer Moderator
    2026-04-26T16:57:28.4666667+00:00

    To convert a Microsoft Publisher file to Word using a macro, run the code from within Publisher because Word does not natively support opening or parsing .pub files. The following VBA code utilizes the SaveAs method with the pbFileWord format constant to export the active publication.

    Sub SavePublisherAsWord()
        Dim currentPath As String
        Dim newPath As String
        If Len(ThisDocument.Path) = 0 Then
            MsgBox "Please save your Publisher file first."
            Exit Sub
        End If
        currentPath = ThisDocument.FullName
        newPath = Left(currentPath, InStrRev(currentPath, ".")) & "docx"
        ThisDocument.SaveAs Filename:=newPath, Format:=pbFileWord
        MsgBox "Exported to: " & newPath
    End Sub
    

    When you execute this macro, Publisher attempts to flow the text from your various text boxes into a single Word document. It is important to understand that Publisher is a desktop publishing tool while Word is a word processor, so absolute positioning of images and overlapping elements may not translate perfectly. If the layout is complex, the resulting Word document will likely require manual adjustment to reposition graphics and fix text wrapping.

    If your goal is to preserve the visual design exactly as it appears in Publisher, a better programmatic approach involves exporting the document to a PDF format and then using Word's built-in PDF Reflow feature to open that file. This generally handles columns and anchored images more gracefully than a direct text-to-word export.


    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?


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.