Results 1 to 6 of 6
  1. #1
    Star Lounger
    Join Date
    Jul 2006
    Location
    Colorado, USA
    Posts
    55
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Page markings (XP)

    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?

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Page markings (XP)

    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:

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

    Hope these help:
    <hr><code>{ 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 } }</code><hr>
    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>post 320421</post#>.

  3. #3
    Star Lounger
    Join Date
    Jul 2006
    Location
    Colorado, USA
    Posts
    55
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Page markings (XP)

    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.

  4. #4
    Star Lounger
    Join Date
    Jul 2006
    Location
    Colorado, USA
    Posts
    55
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Page markings (XP)

    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.

  5. #5
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Page markings (XP)

    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.

  6. #6
    Star Lounger
    Join Date
    Jul 2006
    Location
    Colorado, USA
    Posts
    55
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Page markings (XP)

    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.

Posting Permissions

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