A Microsoft Word forum. Microsoft Office Word Forum - WordBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Microsoft Office Word Forum - WordBanter forum » Microsoft Word Newsgroups » Mailmerge
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Mail merge with existing mail merge fields



 
 
Thread Tools Display Modes
  #1  
Old July 23rd 08, 09:13 AM posted to microsoft.public.word.mailmerge.fields
-kve-
external usenet poster
 
Posts: 2
Default Mail merge with existing mail merge fields

Hi, I'm trying to perform a mail merge (C#, Office 2003/2007)

I started from th ecode given in http://support.microsoft.com/kb/301659, and
this code works fine.

But the problem is: this example creates and inserts the mail merge fields
by code, and I need to use the fields that are already present in a document
(defined in Word).
On mailMerge.Execute(ref oFalse) I always get the error:"Word could not
finish merging these documents or inserting this database"

Any help would be great...
Ads
  #2  
Old July 23rd 08, 11:04 AM posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP
external usenet poster
 
Posts: 8,832
Default Mail merge with existing mail merge fields

Without seeing all of the code that you are using, it would be like shooting
in the dark to try and tell you what is causing the problem.

The code in the article that you referenced, creates the datasource as well
as the mail merge main document and while it saves and closes the datasource
as C:\\DataDoc.doc, I cannot see where it attaches that datasource to the
mail merge main document it creates unless it is done by this bit of code

// Create a MailMerge Data file.
CreateMailMergeDataFile();

I should add that I know zilch about C#

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

"-kve-" wrote in message
...
Hi, I'm trying to perform a mail merge (C#, Office 2003/2007)

I started from th ecode given in http://support.microsoft.com/kb/301659,
and
this code works fine.

But the problem is: this example creates and inserts the mail merge fields
by code, and I need to use the fields that are already present in a
document
(defined in Word).
On mailMerge.Execute(ref oFalse) I always get the error:"Word could not
finish merging these documents or inserting this database"

Any help would be great...



  #3  
Old July 23rd 08, 11:23 AM posted to microsoft.public.word.mailmerge.fields
-kve-
external usenet poster
 
Posts: 2
Default Mail merge with existing mail merge fields

Well, the only difference between my code and the code from the article lies
in the fact that in the article, the merge fields are created at runtim (in
code), and I don't do that (because I use a document that already has the
necessary fields)


"Doug Robbins - Word MVP" wrote:

Without seeing all of the code that you are using, it would be like shooting
in the dark to try and tell you what is causing the problem.

The code in the article that you referenced, creates the datasource as well
as the mail merge main document and while it saves and closes the datasource
as C:\\DataDoc.doc, I cannot see where it attaches that datasource to the
mail merge main document it creates unless it is done by this bit of code

// Create a MailMerge Data file.
CreateMailMergeDataFile();

I should add that I know zilch about C#

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

"-kve-" wrote in message
...
Hi, I'm trying to perform a mail merge (C#, Office 2003/2007)

I started from th ecode given in http://support.microsoft.com/kb/301659,
and
this code works fine.

But the problem is: this example creates and inserts the mail merge fields
by code, and I need to use the fields that are already present in a
document
(defined in Word).
On mailMerge.Execute(ref oFalse) I always get the error:"Word could not
finish merging these documents or inserting this database"

Any help would be great...




  #4  
Old July 23rd 08, 12:37 PM posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP
external usenet poster
 
Posts: 8,832
Default Mail merge with existing mail merge fields

As I said, I do not see in that code where the data source is being attached
to the mail merge main document. Are you creating the data source on the
fly as is being done in that code? Or do you have an existing data source.

I believe that the command to attach the datasource to the mail merge main
document may be missing from the code in that article

I would expect to see a command somewhere along the lines of

wrdMailMerge.OpenDataSource

Sorry I can't help you withe exact C# command, but for the VBA syntax, check
out the OpenDataSource item in the Visual Basic Editor.
--
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

"-kve-" wrote in message
news
Well, the only difference between my code and the code from the article
lies
in the fact that in the article, the merge fields are created at runtim
(in
code), and I don't do that (because I use a document that already has the
necessary fields)


"Doug Robbins - Word MVP" wrote:

Without seeing all of the code that you are using, it would be like
shooting
in the dark to try and tell you what is causing the problem.

The code in the article that you referenced, creates the datasource as
well
as the mail merge main document and while it saves and closes the
datasource
as C:\\DataDoc.doc, I cannot see where it attaches that datasource to the
mail merge main document it creates unless it is done by this bit of code

// Create a MailMerge Data file.
CreateMailMergeDataFile();

I should add that I know zilch about C#

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

"-kve-" wrote in message
...
Hi, I'm trying to perform a mail merge (C#, Office 2003/2007)

I started from th ecode given in
http://support.microsoft.com/kb/301659,
and
this code works fine.

But the problem is: this example creates and inserts the mail merge
fields
by code, and I need to use the fields that are already present in a
document
(defined in Word).
On mailMerge.Execute(ref oFalse) I always get the error:"Word could not
finish merging these documents or inserting this database"

Any help would be great...






 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Add fields to existing mail merge lists Deb Mailmerge 2 July 10th 08 02:04 AM
Can I make a new mail merge from an existing mail merge? KTRen Microsoft Word Help 2 January 15th 08 07:24 PM
How do I add to an existing mail merge table? sandra Mailmerge 1 September 29th 07 04:56 AM
Printing a mail merge doc, merge fields print with grey background Stanby Microsoft Word Help 1 April 12th 06 03:21 PM
Opening an existing mail merge doc Michelle Mailmerge 1 January 17th 05 10:28 AM


All times are GMT +1. The time now is 09:44 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright 2004-2020 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.