Consulting

Results 1 to 2 of 2

Thread: wdPrintCurrentPage Doesn't Work in Word 2013

  1. #1
    VBAX Newbie
    Joined
    Feb 2015
    Posts
    4
    Location

    wdPrintCurrentPage Doesn't Work in Word 2013

    Hello,

    I wanted to post this solution I came up with to solve a problem our business is experiencing in Word 2013 (Office 365) to help others who may be searching for this topic later. This forum frequently shows up in Google searches. Let me know what you think.


    Problem: When using wdPrintCurrentPage in Word 2013 VBA, the macro would run and print the first page of the document and not the current page.

    The document tested on was several pages long and no matter what page was selected it would print the first page.

    Note: We have multiple network printers and part of the code is to define the appropriate printer before printing.


    Original Code:
    ActivePrinter = "\\network-printer-name"
    ActiveDocument.PrintOut Range:=wdPrintCurrentPage
    Work around / Solution Code:
    Sub PrintPage()
    '
    ' PrintPage Macro
    '
    '
        Dim pagenum As String
        pagenum = Selection.Information(wdActiveEndAdjustedPageNumber)
     
        ActivePrinter = "\\network-printer-name"
        Application.PrintOut FileName:="", Range:=wdPrintFromTo, From:=pagenum, To:=pagenum
       
    End Sub

  2. #2
    VBAX Newbie
    Joined
    Feb 2015
    Posts
    4
    Location
    Follow up: Looks like this is an issue due to a software patch.

    Besides re-authoring the code like I did in the original post, The temporary solution to get the original macro working again is to uninstall update KB2965224 (part of the April Patch Tuesday collection). Microsoft will have to fix whatever is wrong with that patch and reissue it.

    Found this bit of information from Microsoft Answers.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •