Microsoft Publisher 2016 缺少 [x of y] 頁碼 - 如何實現此目的?

Microsoft Publisher 2016 缺少 [x of y] 頁碼 - 如何實現此目的?

簡而言之,我們的辦公室一直使用 MS Word 來製作培訓文件。當我開始插入大量照片時,這導致 Word 的格式以最​​令人沮喪的方式崩潰。由於我充滿了想法,我建議我們轉向 Publisher,這使得管理文字和圖像變得容易。

當然,我們的技術作家立即遇到了障礙。 MS Word 允許自動對頁首進行編號,包括目前頁數和總頁數。例如“第 1 頁,共 3 頁”

MS Publisher 僅支援頁面自動編號,僅此而已。我上網查了一下,發現了一個簡短的 VBA 巨集來解決這個問題:

https://answers.microsoft.com/en-us/msoffice/forum/msoffice_other-mso_other-mso_2010/display-page-numbers-in-ms-publisher-2010/499026db-0f47-46a8-8f96-60b0caca7

Dim strPageNumber As String
Dim x As Integer
For x = 1 To Pages.Count
    With ActiveDocument.Pages(x)
        strPageNumber = .PageNumber
        .Shapes.AddTextbox(Orientation:=pbTextOrientationHorizontal, _
            Left:=710, Top:=580, Width:=80, Height:=20) _
            .TextFrame.TextRange.InsertAfter NewText:="Page " _
            & strPageNumber & " of " & .Parent.Count & "."
    End With
Next x

我可以看到正在創建一個文字框,這似乎沒有必要。是否無法使用 VBA 巨集在我選擇的文件中自動插入總頁數?

不幸的是,我不知道如何實現這一點。這似乎確實是微軟的重大疏失。

目前,計劃是跳到最後一頁,獲取頁碼並手動編輯母版中的“of”編號。超尷尬。

相關內容