none
print current page macro RRS feed

  • Question

  • Morning all.

    I've recorded a macro in Word 2013, and would like to trim off the "extra", or non-material components. I.e., if it's not a basic requirement for the macro to work, I want it gone.

    As my current document is in review status, and my markups are showing, the macro recorded including those in my print out as well.

    I do not need the markups, and so would like to exclude those.

    I'm only interested in the contents of the specific page itself.

    TYIA.

    Sub PrintCurrentPage()
    '
    ' PrintCurrentPage Macro
    '
    '
        Application.PrintOut FileName:="", Range:=wdPrintCurrentPage, Item:= _
            wdPrintDocumentWithMarkup, Copies:=1, Pages:="", PageType:= _
            wdPrintAllPages, Collate:=True, Background:=True, PrintToFile:=False, _
            PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _
            PrintZoomPaperHeight:=0
    End Sub

    I've been coding in Excel VBA for close to a decade, but have never done Word macros. I.e., in my early days, I'd record a macro in Excel, and when I'd open up the VBIDE to see what it did, I'd find that it'd add all kinds of extra stuff which wasn't a requirement for the actual operation I was doing. As time went on, I found I could strip that off, and be left with only the basic components.

    Under the item:= element, would I just remove that entirely, or does it require a statement?

    I.e., Item:= wdPrintDocumentWithoutMarkup   ?

    Again, thank you.

    Friday, May 20, 2016 3:33 PM

Answers

All replies