Microsoft Office Forums

Microsoft Office Forums (https://www.msofficeforums.com/)
-   Word VBA (https://www.msofficeforums.com/word-vba/)
-   -   Hide Security Message and Print (https://www.msofficeforums.com/word-vba/35464-hide-security-message-print.html)

rosscortb 05-11-2017 02:13 AM

Hide Security Message and Print
 
Hello,

Before we start I've limited VBA knowledge so Idiot's guide required :)

Our company has security message to classify documents, which when printing appears in the footer unless you hide before printing.

I tried to record a macro, that goes, File, Print, Hide Visual Markings and then Choose Classification(amber). As I have chosen Hide it doesn't appear in the footer after printing.

Code:

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

But, when opening a new document and testing the macro it doesn't work as it brings up the classification window straight away. So, my plan was to set the classification first, hide visual markings then print.

But I get run time error 5941, the requested member of the collection does not exist

It doesn't seem to like the ActiveWindow.Panes(2).Activate

Code:

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

Any ideas?

Thanks

Ross

gmayor 05-11-2017 03:39 AM

Given that you have not explained how the security message works, or what it places in the footer, then we cannot possibly assist with either stopping it or working around it.

At the very least we would need to see a sample document.


All times are GMT -7. The time now is 02:57 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft