Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / March 2004

Tip: Looking for answers? Try searching our database.

Possible to get names of MailMerge fields in the main document?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mstevens2004 - 10 Mar 2004 23:46 GMT
Anyone know how to capture the names of the merge fields in the MAIN document for a merge

The MailMergeFieldNames is only available from a DataSource; however I need to verify that all the MailMerge fields in the destination are valid based on certain criteria

Any assistance would be greatly appreciated

-Marlo
Charles Kenyon - 10 Mar 2004 23:59 GMT
"capture?"

When you have a data source attached, you can use the MailMerge helper or
toolbar to insert only fields that appear in the data source. Are you
talking about verifying the merge results, rather than the fields? If so,
you can use IF fields, but verification is usually best handled on the data
end rather than on the merge end.
Signature


Charles Kenyon

See the MVP FAQ: <URL: 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.

> Anyone know how to capture the names of the merge fields in the MAIN document for a merge?
>
> The MailMergeFieldNames is only available from a DataSource; however I need to verify that all the MailMerge fields in the destination are valid
based on certain criteria.

> Any assistance would be greatly appreciated!
>
> -Marlow
Mstevens2004 - 11 Mar 2004 00:21 GMT
This particular automation process doesn't allow for ANY type of user input, so the destination .doc can not contain invalid merge fields

The app needs to verify that the template which is being used (as the main mail merge document) does not container any mail merge fields which fail a certain criteria

Example

MyTestTemplate.doc contains 3 merge fields
. . . <<<M1>>
. . . <<<A2>>
. . . <<<B1>>

Upon starting the automation-merge process, the MyTestTemplate.doc is opened for processing and will be bound to a mail merge created later in the process

However, based on the data is going to be merged into the document, let's for argument, that the merge field <<<A2>>> is not valid for a particular run.

The app needs to verify all fields BEFORE starting the merge as it can not prompt the end-user for input

So, is it possible to capture the names of the merge fiels in the destination .doc
Charles Kenyon - 11 Mar 2004 01:23 GMT
Again, I don't understand your use of the word "capture." I may be dense or
just showing my ignorance here.

Also, in the situation you are describing, the fields are valid, in that
they link to a data location in your data source. The result of the merge
for that field may not be what you want. I take it this is what you are
talking about here.

Word is not set up to do such pre-merge screening. You can evaluate after
the merge, and based upon that evaluation, you can make the entire merge
result for that data record not display/print. See <URL:
http://word.mvps.org/FAQs/MailMerge/MMergeIfFields.htm>

Again, the best place to screen your data is usually at the data source,
through a properly constructed query. (I preach, not knowing how to
construct such a query, only that it can be done in a relational database.)
I believe you can set up such a screening query within Word as well but
haven't done it. Look in help for information on filtering in a mail merge.
I expect that a filter could be recorded in a macro which could be used to
apply the same filter to future merges using your template. I am speculating
here and someone with more experience will probably step in to confirm my
speculations or blow them out of the water. I would recommend waiting for
that to happen before doing more than reading the help topics and the
following article. <URL:
http://word.mvps.org/FAQs/MailMerge/MMergeQueryOptions.htm>

To hide merge results for a particular record based on the contents of a
particular field requires using IF fields, probably nested IF fields. These
fields test the results of the particular merge field against criteria that
you set. If the mergefield result meets certain criteria, the text you want
(which may be your entire merge document) is displayed/printed. If it does
not, it will not be. (I suspect you may be stuck with at least a blank page,
but am not an expert in this by any means.)

Exact procedures may depend on your version of Word and the nature of your
datasource, but I am not sure of that. It wouldn't hurt for you to put the
version in future posts.

Also, I would recommend that you read Cindy Meister's articles on mail
merge. See: <URL: http://word.mvps.org/Tutorials/FreeToAccess.htm>.

I hope this has been of help to you despite my waffling and ignorance.
Signature


Charles Kenyon

See the MVP FAQ: <URL: 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.

> This particular automation process doesn't allow for ANY type of user input, so the destination .doc can not contain invalid merge fields.
>
> The app needs to verify that the template which is being used (as the main mail merge document) does not container any mail merge fields which fail a
certain criteria.

> Example:
>
[quoted text clipped - 4 lines]
>
> Upon starting the automation-merge process, the MyTestTemplate.doc is opened for processing and will be bound to a mail merge created later in the
process.

> However, based on the data is going to be merged into the document, let's for argument, that the merge field <<<A2>>> is not valid for a particular
run.

> The app needs to verify all fields BEFORE starting the merge as it can not prompt the end-user for input.
>
> So, is it possible to capture the names of the merge fiels in the destination .doc?

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.