LameNerd has asked for the wisdom of the Perl Monks concerning the following question:
Results in this output:use strict; use Win32::OLE; my $MSWord = Win32::OLE->new('Word.Application') or die "Can't get word!:$!\n"; my $doc1 = shift || die "You must specify two word docs\n"; my $doc2 = shift || die "You must specify two word docs\n"; my $docOut = shift || die "You must specify an Output doc\n"; my $WordDoc1 = $MSWord->Documents->Open($doc1) or die "Could not open $doc1\n"; my $WordDoc2 = $MSWord->Documents->Open($doc2) or die "Could not open $doc2\n"; my $WordDocOut = $MSWord->Documents->Open($docOut); print "opened bigdoc.doc\n"; ### ### HERE's my BUG please help :) ### my $select1=$WordDoc1->SelectAll() or die "Could not do SelectAll() on doc1\n"; $select1->Copy(); print "did select all on doc1\n"; $WordDocOut->Paste(); print "did paste\n"; $WordDoc2->SelectAll()->Copy(); print "did select all on doc2\n"; $WordDocOut->Paste(); print "did paste\n"; $WordDocOut->Save(); END { $WordDoc1->Close(); $WordDoc2->Close(); $MSWord->Quit(); }
C:\>catword.pl c:\LINKS.doc c:\TAOandWebServices.doc c:\out.doc opened bigdoc.doc Could not do SelectAll() on doc1I guess there is no SelectAll method ???
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How do I Selecting All in a MSWord doc?
by Mr. Muskrat (Canon) on Jan 24, 2003 at 23:34 UTC | |
by LameNerd (Hermit) on Jan 24, 2003 at 23:40 UTC | |
by Mr. Muskrat (Canon) on Jan 24, 2003 at 23:47 UTC | |
by LameNerd (Hermit) on Jan 24, 2003 at 23:57 UTC | |
|
Re: How do I Selecting All in a MSWord doc?
by Zero_Flop (Pilgrim) on Jan 25, 2003 at 05:53 UTC | |
by Zero_Flop (Pilgrim) on Jan 25, 2003 at 07:51 UTC | |
by Aristotle (Chancellor) on Jan 25, 2003 at 22:22 UTC | |
by Zero_Flop (Pilgrim) on Jan 26, 2003 at 05:27 UTC |