Copying protected text question

  • I have some protected text in my document. If the user selects a range starting before the protected text and ending after it, they can't copy it. However if they select a range starting inside the protected text and ending outside then they can copy it.

    I have tried every ProtectedProp but nothing changes this.

    I thought perhaps the OnBeforeCopyText would be the place to prevent this but I can't figure out how.

    Any help would be appreciated.
    Tony

  • I create the paragraphs like this:

    I have the following ProtectedProp setting:
    [ppParProtected,ppCheckAllText,ppNoNewParagraphsInEditFields,ppProtected,ppIsMergedText,ppProtectSelectedTextToo,ppNoEditAfterProtection]

    If I understand correctly, the protected text is not "field".

    Tony

  • Ah, but it is getting copied in the circumstance I oulined in my first post.

    The difference between my code and your demo is that you didn't put any text in the wpIsXMLTopLevel paragraph, instead you painted the text yourself. My text is of varying length and may be more than one line, so I put the text into the paragraph to let the control handle word wrapping.

    In the demo you can't copy part of the "header" paragraphs because the control doesn't know there are words there (since you painted them).

    In mine however it is allowing the user to select part of the paragraph if the selection area extends outside of the wpIsXMLTopLevel paragraph. This is what I need to prevent, but have been unable to figure out.

    Thanks for any help you can offer.
    Tony

  • In an attempt to block this in my code I have added the following BeforeCopyText procedure to all my TWPRichText objects.

    Would this ever not work?

    Thanks,
    Tony