• Page markings (XP)

    Author
    Topic
    #434384

    I don’t know if this one has been covered before. I didn’t find it in my searches, but I think I saw something similar recently. I would like to be able to do something similar to what I can do in FrameMaker. I would like to have a page marking appear in the footer of a page based upon the styles used on the page.

    If a style called “Confidential” is used, I would like to have CONFIDENTIAL appear in the footer of that page. If a style called “Proprietary” is used, I would like to have PROPRIETARY appear in the footer. Otherwise, just the standard footer. I can do this by inserting a tag with field codes that I can make invisible into the confidential paragraph and then use IF SEQ and PAGE field codes in the footer.

    Is it possible to do this with STYLEREF codes and styles?

    Viewing 0 reply threads
    Author
    Replies
    • #1023957

      Here are two examples from a letter template. These are in the “second page” header and try to copy information from earlier in the letter (on the first page), if it is there. To avoid displaying nasty error messages, I used IF fields to test for either no use of the style or the style not being defined at all. In conceptual terms, the two fields work like this:

      IF (style not in use) THEN (display literal text) ELSE (IF (style not defined) THEN (display literal text) ELSE (use a styleref field))

      Hope these help:[indent]


      { if { STYLEREF AddresseeName * MERGEFORMAT } = "Error! No text of specified style in document." "Name" { IF { STYLEREF AddresseeName * MERGEFORMAT } = "Error! Style not defined." "Name" { STYLEREF AddresseeName * MERGEFORMAT } * MERGEFORMAT } }

      { if { STYLEREF LetterDate * MERGEFORMAT } = "Error! No text of specified style in document." { DATE @ "MMMM d, yyyy" * MERGEFORMAT } { IF { STYLEREF LetterDate * MERGEFORMAT } = "Error! Style not defined." { DATE @ "MMMM d, yyyy" * MERGEFORMAT } { STYLEREF LetterDate * MERGEFORMAT } * MERGEFORMAT } }


      [/indent]As usual, the curly braces must be created using Ctrl+F9. Or you can convert directly to a Word field using the macro in post 320421.

      • #1024020

        I tried this out, but it appears to work only globally. In other words, if the style is used anywhere in the document, the footer is changed on every page of the document. I want it to change on only the pages where the style is used and to default back to the normal footer if it is not used on the page.

        Many thanks.

        • #1024024

          I guess what I said wasn’t entirely correct. The change is not global, just from the last appearance of the style. The STYLEREF searches back through the document for that style if it does not appear on that page. The net result is the same, though. If I could somehow get the STYLEREF to stick to just the present page, it would work.

          • #1024032

            As you discovered, the STYLEREF field does not limit itself to the current page. Although the help description for the p switch seems to suggest that you could assess the position of the “found text” by comparing with a bookmark (perhaps including the PAGE bookmark), the documentation is too skimpy for me to see how it should work.

            • #1024678

              The best I have been able to do so far is to define two styles called Confidential and Proprietary and insert the following into the footer:

              { IF { STYLEREF “Proprietary” } { STYLEREF “Proprietary” l } “PROPRIETARY” { IF { STYLEREF “Confidential” } { STYLEREF “Confidential” l } “CONFIDENTIAL” “UNIMPORTANT” } }

              It will show PROPRIETARY, CONFIDENTIAL, or UNIMPORTANT, depending on the styles used on the page, with Proprietary taking precedence over Confidential. This will work in most instances. It depends on the search forward not matching the search backwards. It doesn’t always work crossing page boundaries and I am always leary that it might have two coincidental matches.

    Viewing 0 reply threads
    Reply To: Page markings (XP)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: