Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Mail Merge Word 2003 Issue | Mailmerge | |||
Mail Merge Final Step in Word 2003 XP | Mailmerge | |||
Word-Excel 2003 - Mail Merge Recipients problem | Mailmerge | |||
Word 2003 and Access 2003 Mail Merge question | Microsoft Word Help | |||
Exchange 2003 - Outlook 2003 - Word 2003 mail merge | Mailmerge |