Results 1 to 9 of 9

Thread: [RESOLVED] Protect word document

  1. #1

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Resolved [RESOLVED] Protect word document

    Is is possible to password-protect a MS Word document so it can't be printed?
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Protect word document

    If you can't open it, you can't print it (at least that is how it would appear to me.)

    Check this out.

  3. #3

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: Protect word document

    Quote Originally Posted by Hack
    If you can't open it, you can't print it (at least that is how it would appear to me.)

    Check this out.
    Of course, but I thought you could do this pretty much like in pdf docs.
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Protect word document

    Word documents and PDF documents are two different animals made by two different companies and each has their own individual requirements.

    If you are dealing with Word, then you need to follow Word's rules.

  5. #5
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,657

    Re: Protect word document

    You can Protect content from being edited by using Forms.

    Right click on the toolbar section of word, to bring up your toolbar list, and select Forms. With the toolbar you can create forms on your document, and then protect them by going to Tools / Protect / Forms.

    This will protect any part of your document which isn't a form (i.e. in grey when you do a form)

    To stop someone printing a doc you have to use VBA. You can intercept the print command by using a macro with the name FilePrint.

    In your code module for the doc paste the following code, it should purpress the print option.

    Sub FilePrint()

    MsgBox "Print disabled"

    End Sub

  6. #6
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Protect word document

    Very cool. Does your code prevent printing from both the print button icon on the toolbar as well as FilePrint?

  7. #7

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: Protect word document

    Quote Originally Posted by NeedSomeAnswers
    You can Protect content from being edited by using Forms.

    Right click on the toolbar section of word, to bring up your toolbar list, and select Forms. With the toolbar you can create forms on your document, and then protect them by going to Tools / Protect / Forms.
    I don't really understand what you're trying to say: why would I create forms and protect them when I actually want to protect the document?
    Quote Originally Posted by NeedSomeAnswers
    This will protect any part of your document which isn't a form (i.e. in grey when you do a form)
    This I don't understand either. You explain how to create and protect forms and then you say this will protect anything but the forms???
    Quote Originally Posted by NeedSomeAnswers
    To stop someone printing a doc you have to use VBA. You can intercept the print command by using a macro with the name FilePrint.

    In your code module for the doc paste the following code, it should purpress the print option.

    Sub FilePrint()

    MsgBox "Print disabled"

    End Sub
    Assuming Hack's issue about the "print" button could be solved, how do you protect the document so that users can't edit the VBA code?
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  8. #8

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: Protect word document

    Quote Originally Posted by Hack
    Very cool. Does your code prevent printing from both the print button icon on the toolbar as well as FilePrint?
    I insist on Hacks's point. It's very nice to trap the print menu routine but can the print button be intercepted as well? Otherwise it's useless.
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  9. #9

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: Protect word document

    Quote Originally Posted by krtxmrtz
    I insist on Hacks's point. It's very nice to trap the print menu routine but can the print button be intercepted as well? Otherwise it's useless.
    All right, I've got it:
    VB Code:
    1. Sub FilePrintDefault()
    2.    MsgBox "I said Print is disabled!!!"
    3. End Sub
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

Posting Permissions

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



Click Here to Expand Forum to Full Width