Protected text with afsProtected

  • Hi

    Im having some troubles converting my "protected text" functionality to WPTools5. Please take a look at the following code. This should simplify my problem. The code inserts a bookmark and write som text inside the bookmark. Everything include the bookmark markers are inserted as protected Text. This worked back in v4.x but in 5.x this will result in text added before or after the bookmark (protected) will also be protected:(

    FYI, my ProtectedProp := [ppProtected,ppIsBookmark,ppAllowEditAtTextEnd,ppProtectSelectedTextToo]

    If I swap the lines marked with // 1 and // 2 everything works fine but that is regarding to the new ppIsBookmark protected. All my old documents made with v. 4.x all have the bookmark inserted as protected text, so I need to handle this to.

    Any Ideas of what I can do? Is it a bug that v. 5.x cant handle it?

  • Hi.

    ppDontUseAttrOfProtected, did the job. I could not find out what it did by looking in the manual. Only using ppIsBookmark and not use afsProtected wont protect the text inside the bookmark. Or is there something I have missed.

    By the way would it be possible to show start and end markers of protected text just like you can do with bookmarks. Maybe by using 'wpobjTextProtection' somewhere?

    • Offizieller Beitrag

    Hi,

    >>ppDontUseAttrOfProtected, did the job. I could not find out what it did by looking in the manual. Only using ppIsBookmark and not use afsProtected wont protect the text inside the bookmark. Or is there something I have missed. <<
    Thats correct, only the marker are protected.

    >>By the way would it be possible to show start and end markers of protected text just like you can do with bookmarks. Maybe by using 'wpobjTextProtection' somewhere?<<

    Version 5 does not use start/end markers for protected text. THe protection through afsProtected is a character style such as afsBold and if you want to set a certain background color for this You can use the property ProtectedTextAttr.

    Julian Ziersch