Results 1 to 7 of 7
  1. #1
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    859
    Thanks
    0
    Thanked 10 Times in 9 Posts

    Content / Form Fields (Word 2007)

    I'm having a look at the "content" fields which are new to Word 2007. The tag seems to be very useful as a means of giving a bit of instruction to the user, but it disappears when I enforce protection for form fill-in. Without protection, and/or and without the tag, the user will not know that I'm looking for information at that particular spot unless I pre-fill the control with "Click here and type." Unlike the legacy controls, I don't have the option to clear the field on entry if the current text is "Click here and type", so the user is left to delete the little announcement before typing. That's a lot of work for a user who just wants to type and get the job done. Unless protection is enforced, the TAB key doesn't jump from field to field, so a mouse click is required.

    I -- and the users I work with -- prefer to have protection on to allow quick nagivation from field to field. The next field might be two pages away... and is likely to be missed unless protection is on and the user can tab through the entire document. Even "click here and type" is likely to be buried and unnoticed in a full page of text.

    I'm perfectly content to stick with the "legacy" controls... but the word "legacy" makes me a bit nervous. Do they have a limited life-span? I always thought that "Click here and type" was one of the most awful features of Word when I began using Word 97.

    Are there options that I'm not seeing?

    Richard

  2. Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #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: Content / Form Fields (Word 2007)

    In earlier versions of Word, if I tabbed into a field, the contents were selected and would be replaced by my first keystroke. Has this changed? Perhaps it's configurable, either at the application level or at the control level.

    I don't know if Legacy Controls will exist in the next version of Word, but considering the long upgrade cycles of large corporate customers, I think they just might.

  4. #3
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    859
    Thanks
    0
    Thanked 10 Times in 9 Posts

    Re: Content / Form Fields (Word 2007)

    If I enforce protection in Word 2007, the content fields behave as they did previously. But they are not shaded, as are the legacy fields (always, never, when selected as previously). As a result, no attention is drawn to them. When you click in the field, a border becomes visible around it.

    If protection is not enforced, the content fields display a tag in the upper left of the field called the Title (the tag is the control name) when the field has focus. But the only entry to the form is via a mouseclick, and the existing text is not selected. Until the cursor is in the field, there's nothing to differentiate if from the "background" text.

    The ideal, of course, would be the best of both worlds: both legacy and content fields shaded (according to choice); Title appears at upper-left of content fields even with protection enforced. The legacy fields have all the familiar options; content fields have a limited selection, no on etnry / on exit macros to be specified.

  5. #4
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    859
    Thanks
    0
    Thanked 10 Times in 9 Posts

    Re: Content / Form Fields (Word 2007)

    As I think about this, I expect that the content field "tag" creates an XML tag. This, in effect, creates an XML hot-spot in the document which will (someday) be controlled by VSTO or VSTA. Code can be written to fire on entry and exit of a node. One of the few properties of content fields is to disallow deletion. That would make sense in regard to code that is node-specific. It looks like this is a work in progress.

  6. #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: Content / Form Fields (Word 2007)

    I found I could apply a character style to the new controls. Setting just the internal style setting (control Properties dialog) was insufficient; it only seemed to format the results, not the placeholder. I had to select the field and apply the style "externally" as well. This worked fine until I deleted the contents of the text field or pressed delete in the combo; in those cases, the external style vanished. Perhaps Word is re-instantiating the control?

    A paragraph style might work around this (in combination with a style separator), but I haven't worked on it further.
    Attached Files Attached Files

  7. #6
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    859
    Thanks
    0
    Thanked 10 Times in 9 Posts

    Re: Content / Form Fields (Word 2007)

    I had a look at your document and I see what you're saying. I think there's a bit of learning to be done here. The shading prints; I was hoping for something to bring attention to the control to assist the user.

    My main interest is in how to manipulate the content fields with VBA. I see a new document method, SelectContentBontrolByTag (or ByTitle). The control isn't actually "selected". To set what we formerly called the "result" of a context control (text type):

    ActiveDocument.SelectContentControlsByTag("RBTag") .Item(1).Range.Text = "Sample text"

    Range.Text makes more sense than the old Result property. Tags and Titles don't have to be unique, so it would be possible to see the text for all content controls which have the same Tag or Title. SelectContentControlsByTag returns a collection that you can iterate through. I also had success with adding a bookmark around the content field, and then got to the content field through the bookmark range.

    The examples in the Help file are quite limited. Not much Help!

  8. #7
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    859
    Thanks
    0
    Thanked 10 Times in 9 Posts

    Re: Content / Form Fields (Word 2007)

    I've been playing with content controls and they are actually very cool. Unlike form fields, the document does not need to be protected for VBA to "fill" the results. I can see the benefit of using content controls (text/rich text type) like bookmarks when assembling a document. In Design Mode, the controls are visible, which is nice. Multiple controls can have the same Tag, so filling "Client Name" for example in 10 places is a quick job. I wrote a function to fill text-type content controls, with an option to delete. It works well.

    There are options to disallow editing or deleting the control. Doing so blocks VBA from editing or deleting without first changing the option, which is easily done. The user can switch to Design Mode and change these settings, unless the document is protected with a password, in which case the user wouldn't be able to delete the control anyway. It would certainly avoid accidental deletion of a critical piece of a document, and that's useful.

Posting Permissions

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