Any advice / comments would be greatly appreciated...
Background: I am writing a Win32::Gui application that stores contacts in flat text files and can then regroup certain ones to make a mail merge letter, amongst other things. I know that there are various other applications around to do a similar sort of thing, but Ichose to do this as there was a request for something similar at work and to take the opportunity to learn some perl. As is probably the case with most of you I find it much easier to learn when doing...
Anyway, when coming to generate the Word mailmerge documnet - actually I am using an existing file and saving it with another name / location after changing the datasource. All of this works fine with the below code
my $datasource="somelocation\\somefile.cdm";
my $savelocation="somelocation\\somefile.doc";
use strict;
use Win32::OLE ;
use Win32::OLE::Const 'Microsoft Word';
my $Word= Win32::OLE->new('Word.Application', 'Quit');
$Word->Documents->Open($template);
$Word->ActiveDocument->MailMerge->OpenDataSource($datasource,);
$Word->ActiveDocument->SaveAs($savelocation);
Note: I used *.cdm as the extension as it was recomended to use something that word did not recognise so that it would not automatically assume the field and recorde delimiters.
When I do this word brings up a dialog box asking me to select the delimters. "|" for field and "~" for record.
Does anyone know how I can tell word what these are and thus avoid this intrusive dialog box?
Look forward to hearring your wisdom.
Cheers,
Gerard.