Computer Forum Forum Index
Register  FAQ Profile Log in to check your private messages Log in Register 

MailMerge with datasource=csv

 
Post new topic   Reply to topic    Computer Forum Forum Index -> microsoft word programming
View previous topic :: View next topic  
Author Message
Chris
Guest





PostPosted: Tue Nov 13, 2007 3:41 pm    Post subject: MailMerge with datasource=csv Reply with quote

Hi,

I created a mailmerge template. Now I wanne feed the template
with a csv file. Is it possible to access a csv file with the
CreateDataSource
method ? Code sample ?
Building a large word datasource is really slow. Or MSAccess is a better
solution ?


Thanks in advance,
Chris
Back to top
Google
Sponsor





PostPosted: Tue Nov 13, 2007 3:41 pm    Post subject: Advertisement

Back to top
Doug Robbins - Word MVP
Guest





PostPosted: Tue Nov 13, 2007 7:36 pm    Post subject: Re: MailMerge with datasource=csv Reply with quote

There is no problem with using a .csv file as the data source for a mail
merge. Are you wanting to do this programmatically?

--
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

"Chris" <chorder@no-spam.init-ka.de> wrote in message
news:exKl0ugJIHA.5360@TK2MSFTNGP03.phx.gbl...
Quote:

Hi,

I created a mailmerge template. Now I wanne feed the template
with a csv file. Is it possible to access a csv file with the
CreateDataSource
method ? Code sample ?
Building a large word datasource is really slow. Or MSAccess is a better
solution ?


Thanks in advance,
Chris

Back to top
Chris
Guest





PostPosted: Wed Nov 14, 2007 10:32 am    Post subject: Re: MailMerge with datasource=csv Reply with quote

I will generate the csv file programmatically.
Afterwards I will feed a mail merge template with the csv file. This should
also done
programmatically.
Someone has a code sample which adds creates a datasource to a csv file ?


Chris


"Doug Robbins - Word MVP" <dkr@REMOVECAPSmvps.org> schrieb im Newsbeitrag
news:exGLMyiJIHA.5400@TK2MSFTNGP04.phx.gbl...
Quote:
There is no problem with using a .csv file as the data source for a mail
merge. Are you wanting to do this programmatically?

--
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

"Chris" <chorder@no-spam.init-ka.de> wrote in message
news:exKl0ugJIHA.5360@TK2MSFTNGP03.phx.gbl...

Hi,

I created a mailmerge template. Now I wanne feed the template
with a csv file. Is it possible to access a csv file with the
CreateDataSource
method ? Code sample ?
Building a large word datasource is really slow. Or MSAccess is a better
solution ?


Thanks in advance,
Chris



Back to top
Chris
Guest





PostPosted: Wed Nov 14, 2007 2:17 pm    Post subject: Re: MailMerge with datasource=csv Reply with quote

I think I got it.
I use the OpenDataSource(..) method and refer to the csv file.
The Header in the csv file is equal named to the merge fields in my
template.

But when a merge field does not match to the data source a dialog pops up.
How can I avoid that ? Or how can I check, if the datasource matches the
merge fields ?


Chris



"Doug Robbins - Word MVP" <dkr@REMOVECAPSmvps.org> schrieb im Newsbeitrag
news:exGLMyiJIHA.5400@TK2MSFTNGP04.phx.gbl...
Quote:
There is no problem with using a .csv file as the data source for a mail
merge. Are you wanting to do this programmatically?

--
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

"Chris" <chorder@no-spam.init-ka.de> wrote in message
news:exKl0ugJIHA.5360@TK2MSFTNGP03.phx.gbl...

Hi,

I created a mailmerge template. Now I wanne feed the template
with a csv file. Is it possible to access a csv file with the
CreateDataSource
method ? Code sample ?
Building a large word datasource is really slow. Or MSAccess is a better
solution ?


Thanks in advance,
Chris



Back to top
Doug Robbins - Word MVP
Guest





PostPosted: Wed Nov 14, 2007 8:20 pm    Post subject: Re: MailMerge with datasource=csv Reply with quote

You should be able to write some code to iterate through the name of the
merge fields in the main document and see if they are included in the fields
in the data source, but what are you going to do if they aren't there? The
user is going to be faced with the same issue and I think that all you will
have done with the code is re-invent the wheel that is causing the dialog to
pop up telling you that a field does not match.

I suppose if it was a single field that did not match, as you interate
through the merge fields in the main document, you could eliminate the
matching ones from the data source fields under consideration so you would
end up with one merge field from the main document that did not match the
remaining field from the data source and then change the field in the main
document. That will not work however if there remained more than one field
in the data source, any one of which could be the one to match with the
field in the main document.

--
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

"Chris" <chorder@no-spam.init-ka.de> wrote in message
news:eIPskksJIHA.5764@TK2MSFTNGP06.phx.gbl...
Quote:

I think I got it.
I use the OpenDataSource(..) method and refer to the csv file.
The Header in the csv file is equal named to the merge fields in my
template.

But when a merge field does not match to the data source a dialog pops up.
How can I avoid that ? Or how can I check, if the datasource matches the
merge fields ?


Chris



"Doug Robbins - Word MVP" <dkr@REMOVECAPSmvps.org> schrieb im Newsbeitrag
news:exGLMyiJIHA.5400@TK2MSFTNGP04.phx.gbl...
There is no problem with using a .csv file as the data source for a mail
merge. Are you wanting to do this programmatically?

--
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

"Chris" <chorder@no-spam.init-ka.de> wrote in message
news:exKl0ugJIHA.5360@TK2MSFTNGP03.phx.gbl...

Hi,

I created a mailmerge template. Now I wanne feed the template
with a csv file. Is it possible to access a csv file with the
CreateDataSource
method ? Code sample ?
Building a large word datasource is really slow. Or MSAccess is a
better
solution ?


Thanks in advance,
Chris





Back to top
Chris
Guest





PostPosted: Thu Nov 15, 2007 3:52 pm    Post subject: Re: MailMerge with datasource=csv Reply with quote

Hi Doug,

the problem I am facing with:
I have a server task that generates mail merge letters for customers with
custom templates. When some merge fields does not match with the datasource
the generating is blocking my server process. Therefore it is a good idea
to check the merge field in the template before starting the generation. If
some
merge fields does not match throwing an error is a good issue.


Chris




"Doug Robbins - Word MVP" <dkr@REMOVECAPSmvps.org> schrieb im Newsbeitrag
news:uLHJTvvJIHA.5468@TK2MSFTNGP05.phx.gbl...
Quote:
You should be able to write some code to iterate through the name of the
merge fields in the main document and see if they are included in the
fields in the data source, but what are you going to do if they aren't
there? The user is going to be faced with the same issue and I think that
all you will have done with the code is re-invent the wheel that is
causing the dialog to pop up telling you that a field does not match.

I suppose if it was a single field that did not match, as you interate
through the merge fields in the main document, you could eliminate the
matching ones from the data source fields under consideration so you would
end up with one merge field from the main document that did not match the
remaining field from the data source and then change the field in the main
document. That will not work however if there remained more than one
field in the data source, any one of which could be the one to match with
the field in the main document.

--
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

"Chris" <chorder@no-spam.init-ka.de> wrote in message
news:eIPskksJIHA.5764@TK2MSFTNGP06.phx.gbl...

I think I got it.
I use the OpenDataSource(..) method and refer to the csv file.
The Header in the csv file is equal named to the merge fields in my
template.

But when a merge field does not match to the data source a dialog pops
up.
How can I avoid that ? Or how can I check, if the datasource matches the
merge fields ?


Chris



"Doug Robbins - Word MVP" <dkr@REMOVECAPSmvps.org> schrieb im Newsbeitrag
news:exGLMyiJIHA.5400@TK2MSFTNGP04.phx.gbl...
There is no problem with using a .csv file as the data source for a mail
merge. Are you wanting to do this programmatically?

--
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

"Chris" <chorder@no-spam.init-ka.de> wrote in message
news:exKl0ugJIHA.5360@TK2MSFTNGP03.phx.gbl...

Hi,

I created a mailmerge template. Now I wanne feed the template
with a csv file. Is it possible to access a csv file with the
CreateDataSource
method ? Code sample ?
Building a large word datasource is really slow. Or MSAccess is a
better
solution ?


Thanks in advance,
Chris







Back to top
Display posts from previous:   
Post new topic   Reply to topic    Computer Forum Forum Index -> microsoft word programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Computer Forum