I would like to perform a mail merge with Word 2007 and a tab delimited text file using Perl. I have tried the code below but all it does is create a copy of the Word template without any merge taking place. I think I'm missing something somewhere as I am not well versed in Perl. When I do the merge manually it works fine. Can someone help me out?
Thanks in advance for any and all help, Carluse strict; use warnings; use Win32::OLE ; use Win32::OLE::Const 'Microsoft Word'; my $sourcefile='C:\Users\Carl\Documents\AddressMergeTXT.txt'; my $mergefile='C:\Users\Carl\Documents\Merge.docx'; my $template = 'C:\Users\Carl\Documents\MergeLetter.docx'; my $Word= Win32::OLE->new('Word.Application', 'Quit'); $Word->Documents->Open($template); $Word->ActiveDocument->MailMerge->OpenDataSource($sourcefile); $Word->ActiveDocument->SaveAs($mergefile);
In reply to Mail Merge with Word 2007 and Perl by cmiller2005
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |