Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

OUTLOOK new mail with attachment

by harryC (Sexton)
on Dec 11, 2012 at 09:29 UTC ( #1008250=perlquestion: print w/replies, xml ) Need Help??
harryC has asked for the wisdom of the Perl Monks concerning the following question:

I only want to start outlook on de screen not in the background. Create a new mail and add a attachment.
So that the user can fill in the addresses,subject and the mail content and send the mail from the screen.
The same as in OpenOffice send document as attachment.
How do i do this ?
I looked around and always find code which sends mail in the background.
Thks for your help HarryC

my $Outlook = Win32::OLE->GetActiveObject ('Outlook.Application') || Win32::OLE->new('Outlook.Application'); $Outlook->{'Visible'} = 1;

does not work
Win32::OLE(0.1709) error 0x8002000e: "Ongeldig aantal parameters" in PROPERTYPUT "Visible" at D:\scripts\ line 11

Thks for your help HarryC

Replies are listed 'Best First'.
Re: OUTLOOK new mail with attachment
by harryC (Sexton) on Dec 11, 2012 at 11:41 UTC

    found is myself after hours op looking and is was so easy

    my $outlook = new Mail::Outlook(); # create a message for sending my $message = $outlook->create(); $message->To(' '); $message->Cc(' '); $message->Bcc(' '); $message->Subject(' '); $message->Body(' '); # attachments are appended $message->Attach("$home_dir\\test.pdf"); # so multiple calls ar +e allowed $message->display;

    you must have ' ' otherwise it does not work rgds HarryC

Re: OUTLOOK new mail with attachment
by Anonymous Monk on Dec 11, 2012 at 09:38 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1008250]
Approved by Athanasius
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (9)
As of 2018-05-25 14:26 GMT
Find Nodes?
    Voting Booth?