Oh, here's the perl code to make IE do what I want it to do, in case anyone can use it. For me, IE's too tempermental...
Expand|Select|Wrap|Line Numbers
- #!/usr/bin/perl
- use strict;
- use warnings 'all';
- use Win32::OLE;
- use Win32::OLE::Const 'Microsoft Internet Controls';
- use Win32::OLE::Variant;
- # From Vc7/PlatformSDK/Include/MsHtmHst.h :
- use constant PRINT_DONTBOTHERUSER => 0x01;
- use constant PRINT_WAITFORCOMPLETION => 0x02;
- my $file = "C:\\FixReportBase\\realtest\\pg_0001.htm";
- my $do_not_prompt = 0;
- my $nCmdID = OLECMDID_PRINT;
- my $nCmdExecOpt = OLECMDEXECOPT_PROMPTUSER;
- my $pvaIn = PRINT_WAITFORCOMPLETION;
- my $pvaOut = 0;
- if ($do_not_prompt) {
- $nCmdExecOpt = OLECMDEXECOPT_DONTPROMPTUSER;
- $pvaIn |= PRINT_DONTBOTHERUSER;
- }
- my $IE = Win32::OLE->new('InternetExplorer.Application') or die;
- #$IE->{'Visible'} = 1;
- $IE->Navigate( $file );
- sleep 1 while $IE->{Busy};
- $IE->ExecWB($nCmdID, $nCmdExecOpt, Variant(VT_I2,$pvaIn), $pvaOut);
- $IE->Quit();