How to block some part of the document from getting printed

J

Jey

Hi ,

I have a word document in which there are many sections( have placed cont.
section break between all sections ). For eg

Section1
Sample for first section

Section2
Sample for second section

Section3
Sample for third section

Section4
Sample for fourth section

I provide this document to various users. The follwoing are my requirements

1.I should be able to protect my sections with different password and not
with a single password

2.When user click on print , only section1 and 3 should be printed. the rest
should not be printed.

Please let me know how I can complete this.
 
C

Chip Orange

Jey,

If you insert two macros with the specific names of those given below, you
can intercept and control the printing process. In my case, I never wanted
the last section to print, but you can adjust the print specifications to
the printing dialog to list just sections 1 and 3. I'll make a guess in the
code below as to how that should be:


Sub FilePrint()
'
' FilePrint Macro
' Prints the active document, but only sections 1 and 3.
'

With Dialogs(wdDialogFilePrint)
..pages = "s1,s3"
..Show ' display the file print dialog with some fields already prefilled.
End With
' if you'd rather not give them any control over the printing process, you
can suppress the dialog and use this command:
' activedocument.printout(pages := "s1,s3")

End Sub




Sub FilePrintDefault()
'
' FilePrintDefault Macro
' Prints the active document using the current defaults
'
Call FilePrint

End Sub
 
F

fumei via OfficeKB.com

2.When user click on print , only section1 and 3 should be printed. the rest
should not be printed.

You can do this with the code Chip supplied. Note that FilePrintDefault is
executed by the Print icon button. FilePrint is executed by the File > Print
menu selection. They are two separate Word commands. Chip is redirecting
the Print button command to the menu item command.

As for different passwords for different Sections, I do not know of a way to
do this. Document protection (for forms, which handles Section protection)
is global. I do not even see why you would want to do this. Ummm, why DO
you want to do this?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top