Word 2007: Create a referenced date control with a default date

H

happysad

I am trying to do the following for a client:

A template for a letter has a locked (grouped, but not protected) section on
the first page containing content controls for name, address and date.

On the following pages there is a header with REF fields referencing
bookmarks around the content controls on the first page. This works fine for
copying the data to the header.

Now I want a default date in the date control on the first page, so I add a
CREATEDDATE field inside the control. This gets filled in automatically when
the document is generated, and the user can change the date if he wants -
that much works.
BUT - the REF field in the header does not pick up the automatically
generated date. Only after the user changes the date, does the REF field get
the correct value.

Works:
CREATEDATE with bookmark and referenced by REF
Bookmark and content control and referenced by REF

Does not work:
CREATEDATE with bookmark and content control and referenced by REF

Can it be solved? I have a macro that runs at startup, but I don't believe I
can use macros for this problem.
 
D

Doug Robbins - Word MVP

With a Rich Text Content Control containing a CreateDate field with the
whole content control bookmarked and a ref field to the text of that
bookmark in the header in a .dotm template, what you describe works here.

When I had tried saving the template as a .dotx however, there was no new
document created when I selected that template as the basis of a document.
I admit however, that I have never used a .dotx template before so do not
know anything about them.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
G

Graham Mayor

REF fields in headers do not update automatically. You could apply a
uniquely named character style to the date (based on the underlying style)
and use a styleref field in the header. Styleref fields constantly update -
but will not take the data from inside a content control.
Why do you need a content control for the date? Simply insert the Createdate
field in the document body and/or the header as required.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
D

Doug Robbins - Word MVP

Hi Graham,

In the case where the Ref to the text of the bookmark actually replicates
the content control containing the CreateDate field, the date in the header
does "update" to show the date that the document is created from the
template.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
H

happysad

Yes! I can also get it to work with the Rich Text Content Control.
Strange, when the Text Content Control and Date Content Control don't work.

(I need it to be a content control because the field is in a grouped table.
It is not possible to edit outside the content controls.)
 
H

happysad

I got the RTF control working with the deafult date and the REF field.

But now the tab order is no longer working after the cursor reaches the date
field.
I think it is because TABs can be entered in an RTF control.

Can it be fixed somehow? Or is there a way to trick Word so it skips over
the RTF control when tabbing?

The date field is in the first row of the 2nd column in a 2 column table.
The table is grouped.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top