in reply to Re: Re: Re: Outlook MailItem Body Question
in thread Outlook MailItem Body Question

Yeah, that's not it either... Body is an attribute, not a method, unfortunately.
  • Comment on Re: Re: Re: Re: Outlook MailItem Body Question

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Outlook MailItem Body Question
by BrowserUk (Patriarch) on Jan 06, 2004 at 19:40 UTC

    Did you actually try it?

    I realise that Body may be described as an attribute in the OLE documentation for Outlook, but the error message certainly imples that it ends up being implemented as a method within Win32::OLE.

    The error message is pretty indicative.

    { my $s = 'the quick brown fox'; sub Body{ ($s) = @_ if @_; $s } } print Body(); the quick brown fox Body = 'fred'; Can't modify non-lvalue subroutine call in scalar assignment at (eval +3) line 1, at EOF Body( 'fred' ); print Body(); fred

    If you did try it, what error message did you get from the attempt?


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail
    Hooray!

      Hmm, it seems if you try it as Body($mybody) instead of {'Body'} = $mybody you get an error "Invalid number of parameters" from Win32::OLE. For what it's worth, http://perlmonks.thepen.com/185757.html seems to think the {'Body'} method is correct.