Results 1 to 7 of 7
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    La Jolla, CA
    Posts
    1,470
    Thanks
    30
    Thanked 62 Times in 58 Posts

    REF field code not applying correct formatting

    I have several REF field codes pulling from bookmarks. ONE of them (SellerFullName) changes the formatting. UGH.

    Why do the others work and this one doesn't? Must be some stupid thing I'm doing.

    TIA

    Trying to get around this, I recorded a macro that uses:

    Selection.WholeStory
    Selection.Font.Name = "Times New Roman"
    Selection.Fields.update

    However, after running the macro, the entire doc (story) remains selected.
    How do I turn off that entire selection within the macro?
    Attached Files Attached Files
    Last edited by kweaver; 2016-03-01 at 14:04.

  2. #2
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts
    Cross-references use REF fields. REF fields with the 'preserve formatting' option checked, which adds the \* MERGEFORMAT switch, often do not reliably maintain the source formatting; they're especially prone to messing it up when the referenced range expands. If you want to control a cross-reference's format, you need to use a \* Charformat switch. To apply a \* Charformat switch to a cross-reference:
    • Select the cross-reference and press Shift-F9 to expose the field code, which will look something like { REF BkMk } or { REF BkMk \h}, where BkMk is a bookmark name.
    • If you see a \* MERGEFORMAT switch, delete it.
    • Format at least the R of REF with the font characteristics you want to apply to the cross-reference.
    • Add the \* Charformat switch to the field code.
    • Press F9 to update.
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  3. The Following User Says Thank You to macropod For This Useful Post:

    kweaver (2016-03-01)

  4. #3
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    La Jolla, CA
    Posts
    1,470
    Thanks
    30
    Thanked 62 Times in 58 Posts
    Thanks for 2 good pieces of advice. What a pain. I think it might be easier to deal with a mail merge from Excel.
    Am experimenting with both now.

  5. #4
    Silver Lounger Charles Kenyon's Avatar
    Join Date
    Jan 2001
    Location
    Sun Prairie, Wisconsin, Wisconsin, USA
    Posts
    2,049
    Thanks
    124
    Thanked 119 Times in 116 Posts
    You still will want to use the CHARFORMAT switch.
    Charles Kyle Kenyon
    Madison, Wisconsin

  6. #5
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts
    Quote Originally Posted by Charles Kenyon View Post
    You still will want to use the CHARFORMAT switch.
    Only if the output is to be formatted differently from the surrounding text.
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  7. #6
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    La Jolla, CA
    Posts
    1,470
    Thanks
    30
    Thanked 62 Times in 58 Posts
    Thanks again. I just found that out on my own as well. Thank goodness for those switches!

  8. #7
    Silver Lounger Charles Kenyon's Avatar
    Join Date
    Jan 2001
    Location
    Sun Prairie, Wisconsin, Wisconsin, USA
    Posts
    2,049
    Thanks
    124
    Thanked 119 Times in 116 Posts
    Quote Originally Posted by macropod View Post
    (Use CHARFORMAT) Only if the output is to be formatted differently from the surrounding text.
    I agree, I generally use it because it makes my fields much more predictable. Of course, unless I deliberately do it differently, the first character of the field is formatted like surrounding text.
    Charles Kyle Kenyon
    Madison, Wisconsin

Posting Permissions

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