How to update mailmergefields?

F

FL Consultant

I am creating a VBA that will update mailmerge documents. One set of data to
many files. One of the MVPs suggested a good start. I am not finding a way
to use the MailMergeField to be able to update the field itself. I have
looked through the methods but I am a bit rusty on Oject Oriented code. I
would appreciate some additonal insight.

Thank you
 
J

Jean-Guy Marcil

FL Consultant was telling us:
FL Consultant nous racontait que :
I am creating a VBA that will update mailmerge documents. One set of
data to many files. One of the MVPs suggested a good start. I am
not finding a way to use the MailMergeField to be able to update the
field itself. I have looked through the methods but I am a bit rusty
on Oject Oriented code. I would appreciate some additonal insight.

Mailmerge fields cannot be updated as such. You insert mailmerge fields in a
document, then you execute a merge. Once the merge is finished, the
resulting document does not contain fields anymore.

What is it you are trying to do exactly? Also, it would help us help you if
you posted the relevant code so that we can see what you have and give you
useful pointers.
As is, your post is very vague...

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
F

FL Consultant

Thank you for responding. What I am attempting to do is to take one set of
data and update many documents. The data consist of name, address, phone,
and other information. The document are different contracts that all need
the same data. There are in fact a total of 250 contracts.

One MVP suggested using Find & ReplaceAll (BatchReplaceAll()) from the MVP
website. That was good suggested except it will only work with one piece of
data.
I do not have any code thou I am developing some test stuff as I experiment.

It seems to me that there must be a way to do what I want to do. For
example, I am able to locate the MailMergeField. Is there a way to change
the field, and than I could print the new document or save it as new
document. By printing or saving the changed document, I would not change the
original document that contains the MailMergeFields and the document could be
used again for MailMerging.

Is there a method that will allow me to change the MailMergeField? Or is
there another way to do what I am attempting to do?

I have since learned that the initial need for me to create this
funtionality is no longer needed but as a programmer I still feel challenaged
and would like to see if I can make this work.

I hope this response gives you the information you need and I thank you for
taking the time to respond and any suggestions you might have.
Thanks
 
J

Jean-Guy Marcil

FL Consultant was telling us:
FL Consultant nous racontait que :
Thank you for responding. What I am attempting to do is to take one
set of data and update many documents. The data consist of name,
address, phone, and other information. The document are different
contracts that all need the same data. There are in fact a total of
250 contracts.

One MVP suggested using Find & ReplaceAll (BatchReplaceAll()) from
the MVP website. That was good suggested except it will only work
with one piece of data.

You can do the "Replace" routine many times. The best is to create a
Function that does the Find/Replace and to call this function as often as
you need passing it string variables to specify the find text and the
replace text.
I do not have any code thou I am developing some test stuff as I
experiment.

It seems to me that there must be a way to do what I want to do. For
example, I am able to locate the MailMergeField. Is there a way to
change the field, and than I could print the new document or save it
as new document. By printing or saving the changed document, I would
not change the original document that contains the MailMergeFields
and the document could be used again for MailMerging.

Is there a method that will allow me to change the MailMergeField?
Or is there another way to do what I am attempting to do?

If all the documents are merge source documents, i.e. they contain mailmerge
fields prior to a merge, look at the Code property of the mailmerge field
object.

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
F

FL Consultant

Thank you for your assistance.
--
FL Consultant


Jean-Guy Marcil said:
FL Consultant was telling us:
FL Consultant nous racontait que :


You can do the "Replace" routine many times. The best is to create a
Function that does the Find/Replace and to call this function as often as
you need passing it string variables to specify the find text and the
replace text.


If all the documents are merge source documents, i.e. they contain mailmerge
fields prior to a merge, look at the Code property of the mailmerge field
object.

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

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