Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Apr 2003
    Location
    Ottawa, Ontario, Canada
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    XRef Macro (Word 2002 or 2003)

    Forgive the detour in getting to my question but some background.

    In FrameMaker, it's easy to create cross-reference styles--for example, one style can be used to create "See Section 123, Widgets, on page 20" and another style can be used to create "See Widgets ." Note that the first Xref is optimized for traditional print usage; the second is a standard hyperlink format (underlined, no page or section numbers). The actual Xref is constructed as a series of formats (italics, underlines), program functions (section and page numbers, title text), and constants ("See Section" and "on page "). These components are all strung together to make a named Xref template that can then be called to create the actual Xref. This is done in a manner akin to Word--pick an Xref target, click the Xref template you want, and Frame does the rest. This is very efficient from an authoring/layout perspective and it allows for some neat single-source alternatives.

    I could, for example, have two document style sheets. The first is for print, the second for online. If I employ the same style names (including Xref template names) during tagging, I can, with a click or two, flip style sheets and go from a print doc with qualified Xrefs to an online doc with hyperlinks. Dump it out to Acrobat and I have the best of all worlds.

    This is precisely what I need to do, in fact, with a book I'm working on. I'm constrained to using Word and the customer won't buy in to purchasing a copy of Quadralay, which would allow for reasonable HTML conversion (versus Word's truly ugly convert to HTML).

    So, at long last, is there a way to achieve this in Word? Undoubtedly, it will require some degree of macro coding (about which I know less than my cat), but is this a feasible coding exercise? Or will I end up spending more time on the macros than on writing the book?

    Thanks for any help, insights, or pointers to commercially available solutions for this requirement.

    Charles

  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: XRef Macro (Word 2002 or 2003)

    I believe that if you use the Styles Organizer to copy in same-named styles from a source document or template, they will modify the formatting of the existing text with that style. So as long as you maintain two "style sheets" in either document or template form, you should be able to "apply" the one you want manually. Due to nesting of style definitions, it is recommended to copy the styles 3 times. No more, no less. (I just added that last part as grim humor. In fact, the multiple copying should be repeated as many times as needed to resolve all dependencies.)

  3. #3
    New Lounger
    Join Date
    Apr 2003
    Location
    Ottawa, Ontario, Canada
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: XRef Macro (Word 2002 or 2003)

    I was aware that the styles organizer will do this (although I wasn't aware of the need to do multiple copies to resolve dependencies). That doesn't address the need, however, to produce different style "templates" for Xrefs in particular. IOW, an Xref template for hyperlink Xrefs (no page number, no section number, just the underlined title/heading text) and another style template for print Xrefs ("See Section xxx, Subhead, on page xx"). It's that latter part--the style templates--that's my problem. I don't want to have to go through the document and change print-style xrefs to online-style and vice versa.

  4. #4
    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: XRef Macro (Word 2002 or 2003)

    Oh, I missed that the text needs to be different (not the style applied to the text).

    It seems best to use the IF field construct, and perhaps you could automate the creation of all of its various parts, though this is beyond my knowledge (I don't use hyperlink cross-references inside Word documents).

    { IF { DOCPROPERTY Output } = "Print" "See some reference" "See { HYPERLINK l "_xxxxx" }" }

    There are other ways to set the toggle, including document variables or an ASK field. I just chose a custom document property because it's easy to test. <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

Posting Permissions

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