in reply to Re: cat worddoc1.doc worddoc2.doc worddoc3.doc > bigOlWordDoc.doc
in thread cat worddoc1.doc worddoc2.doc worddoc3.doc > bigOlWordDoc.doc

I can't seem to get this line to work.
my $WordDoc1 = $MSWord->{Documents}->Open($doc1,0,1);
$WordDoc1 is undefined after that statement so
$WordDoc1->SelectAll()->Copy();
fails with
Can't call method "SelectAll" on an undefined value at C:\catword.pl line
Thanks for that link but I do not know how to translate VB to Perl.
Can you give me a little more help?

Replies are listed 'Best First'.
Re: Re: Re: cat worddoc1.doc worddoc2.doc worddoc3.doc > bigOlWordDoc.doc
by meetraz (Hermit) on Jan 24, 2003 at 20:42 UTC
    Do you have MSWord installed? Is $MSWord defined before you try the open() ?
      Yes I have MSWord installed.
      And I check that $MSWord is defined with die
      my $MSWord = Win32::OLE->new('Word.Application') or die "Can't get wor +d!:$!\n";
      Is that the right way to verify that $MSWord is defined? Thanks again :)