Reply
 
Thread Tools Display Modes
  #1   Report Post  
tpark
 
Posts: n/a
Default Mail Merge with C# and Word 2003

I need to automate a simple mail merge using c# and am having no luck.
I tried the code on MSDN "How to automate Word to perform mail merge
from visual C#" and got all the same errors that everyone else is
getting. i.e Cannot apply indexing with [] to an expression of type
'Word.Tables'

If someone has a solution to this I would appreciate it. If not all I'm
looking for is to simply automate a mail merge using c# from a comma
delimited text file with Word.

I want to hit a button on the application and all it does is grab the
comma delimited text file, walk through the records and do a mail merge
and print each record out accordinly. It doesn't seem like this should
be too hard but I haven't been able to accomplish it.

If anyone has some useful links or sample code please let me know.
Thank you,
Todd

  #2   Report Post  
Doug Robbins
 
Posts: n/a
Default

I can't help you with the C# side of it, but if the mailmerge maindocument
was in the form of a template with an autonew macro (VBA) in it to perform
the mailmerge, all you would need to do in C# is get Word to create new
document based on the template.

At some point, you are probably going to need the information in the article
"How to do a mail merge to the printer using VBA, without displaying the
Print dialog" at:

http://word.mvps.org/FAQs/MailMerge/...PrintrWVBA.htm


--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
"tpark" wrote in message
ups.com...
I need to automate a simple mail merge using c# and am having no luck.
I tried the code on MSDN "How to automate Word to perform mail merge
from visual C#" and got all the same errors that everyone else is
getting. i.e Cannot apply indexing with [] to an expression of type
'Word.Tables'

If someone has a solution to this I would appreciate it. If not all I'm
looking for is to simply automate a mail merge using c# from a comma
delimited text file with Word.

I want to hit a button on the application and all it does is grab the
comma delimited text file, walk through the records and do a mail merge
and print each record out accordinly. It doesn't seem like this should
be too hard but I haven't been able to accomplish it.

If anyone has some useful links or sample code please let me know.
Thank you,
Todd



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mail Merge Word 2003 Issue S.Nicks Mailmerge 5 February 20th 09 01:55 AM
Mail Merge Final Step in Word 2003 XP blnorwood Mailmerge 2 January 14th 05 06:02 AM
Word-Excel 2003 - Mail Merge Recipients problem AYager Mailmerge 2 January 11th 05 04:11 AM
Word 2003 and Access 2003 Mail Merge question HD87glide Microsoft Word Help 2 December 15th 04 02:29 PM
Exchange 2003 - Outlook 2003 - Word 2003 mail merge Micheline Mailmerge 1 December 2nd 04 11:51 AM


All times are GMT +1. The time now is 06:27 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"