Date Field in Merge Document

K

Karen Hart

How do I create a form file that upon merging inserts the current date of
the merge, then does not update after that point? In other words, after the
merge is complete, the resulting document's date field should be
automatically unlinked. I do not want to teach the user to unlink the field
with Ctrl-Shift-F9, because there are several of these date codes throughout
the form file, inlcuding headers and footers, and also I don't want to risk
that the user forgets to unlink the date field.

Thank you in advance.
Karen
 
G

Graham Mayor

Use a CREATEDATE field for the date and merge to a new document. The new
document will always show the date of the merge.

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
K

Karen Hart

Thanks so much, Graham. You dah man!
Is there a similar function for the document id code? To insert the new name
and path of the resulting merged document?
 
C

Charles Kenyon

You can insert the field for this but realize it won't give a real name
until after the document is saved and the field is updated.
 
K

Karen Hart

By just inserting the path/filename merge code?

Charles Kenyon said:
You can insert the field for this but realize it won't give a real name
until after the document is saved and the field is updated.
 
G

Graham Mayor

You would have to merge to a new document, save that document then insert
the field. As Charles has indicated the name doesn't exist until the
document is saved and it is not saved as part of the merge process.

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
K

Karen Hart

Thank you Graham, that is what I realize. Because of that, I am trying to
create a form file that will have some kind of automated coding so the end
user does not have to know to do these steps that you outline below after
they save and name the document. It would be ideal if I could code something
in the pre-merged document. For example, in Corel, the filename/path code
can be inserted pre-merge, and take on the new document name after it is
merged and saved as a new document.
 
C

Charles Kenyon

It is a field on the header footer AutoText menu or available through Insert

You can put the field into your merged document but it will not show a
correct name and path until after the document is saved and the field is
updated. If in a header / footer it will generally be updated when you print
or do a print preview. If in the body, you'll need something that updates
your fields.

I had thought you could put it in the primary merge document before the
merge, but checked when I read Graham's post and was mistaken. Word converts
the field to text during the merge. (The primary way I use mail merge is to
merge to the screen for a single client. I then print and save the merged
document, with active fields. So putting it in the primary merge document
works for me. I realize that most people actually perform a merge for
multiple files.)

It should be relatively simple to put together a processing macro that (1)
performs the merge, (2) saves the result document, (3) inserts the field you
want (which will then be correct when inserted), and then saves the document
again. This could be put on a (floating) custom toolbar for your users to
perform the merge.

The following is the command to insert the field.
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, _
Text:= "FILENAME \p ", _
PreserveFormatting:=False

Hope this helps,
 
K

Karen Hart

Graham,
I tried that and am getting a strange result. The resulting merged document
is displaying the date the original merge form was created...not the date
the original merge form is being merged. Does that make sense? In other
words, I changed the form document on Jan. 14 and coded the date to be
CREATEDATE. Now, every time the form is merged, the resulting date
displayed is Jan. 14. What am I doing wrong?
Thank you.
Karen
 
C

Charles Kenyon

Have your original merge form be a template. Create a new merge form from it
using File>New for each merge.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
K

Karen Hart

Thank you Charles, but...Since we already have tons of documents set up as
merge files, heavily coded with all kinds of data fields, if statements,
etc., how can we accomplish this date function without going your suggested
route? We would like to keep all these docs as merge forms rather than
changing them all over to templates.
 
C

Charles Kenyon

Template and merge form are not mutually exclusive types. Save your merge
forms as templates, in an appropriate Workgroup templates folder. When you
want to do a merge, create a new document based on the template (File > New)
and merge to it. Links to your database established in the template will be
maintained.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
K

Karen Hart

Thank you again Charles, but since I explained that this is not the route
we want to take for a multitude of reasons, that are too numerous to go into
at this time, are you suggesting that there is NO mergedate solution if the
files remain merge files?
Karen
 
C

Charles Kenyon

There is no automatic route I know of for you to take unless you are willing
to change your merge files into templates and create new documents based on
the templates. Once such a new document is created from the template, with
your updated date in it, you can merge it.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
G

Graham Mayor

The date in the createdate in the merge source document is irrelevant. If
you merge to a new document the date that document is created becomes the
createdate for that document. If the field shows the wrong date select all
(CTRL+A) then update (F9). That should fix it.

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
K

Karen Hart

Thank you so much for replying, Graham. Coincidentally, I was on your web
site checking it out exactly when your reply came :) What a cool web site!
I love it! And I love that cute little thing that follows my pointer
around!

Anyway, once again, I tried...I insert this into the merge MAIN document:
{CREATEDATE \@ "MMMMd, yyyy" \* MERGEFORMAT}.

But sure enough, when I merge it, this is what I see:
August 24, 2000
(This is the date I originally created this merge source document).
(Ctrl-A), (F9) is changing nothing, no matter if I do it before and/or after
merging.
Please help me out of the twilight zone!!

Thanks again,
Karen
 
C

Charles Kenyon

I believe that the merge changes the field to its results, so an F9 after
the merge wouldn't find a field to update.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
G

Graham Mayor

This is not going to work :( That's what comes from not testing the
suggestions before posting.

Change the field back to a DATE field, update it, then merge to a new
document
CTRL+A then CTRL+SHIFT+F9
will fix it.


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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
G

Graham Mayor

I think you are in a minority of those who comment :)

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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