Need help making Microsoft Oulook 2011 speak sender & subject of msgs

I’m trying to get my Outlook 2011 to speak the sender and subject of new messages. I found and modified a script that works for Entourage, but I get an error at one point. Here’s the line:

set mysender to the display name of sender of theMsg as string

and the error:

“Can’t make «class dspn» of «class sndr» of item 1 of {«class inm » id 40709 of application "Microsoft Outlook"} into type string.”

When I add this line:

get the sender of theMsg

it returns:

{name:“John Doe”, address:"john@doe.com"}

(I substituted John Doe for the actual name and address)
How do I get Applescript to extract the sender’s name so it can speak it? Thanks.

Kevin

Hi,

it seems that the sender record has no display name key,
so try


set mysender to (get name of sender of theMsg)

I substituted your line, and now it get the error, “Microsoft Outlook got an error: Can’t make name of sender of incoming message id 40709 into type specifier.”

Kevin

hi

I don’t have outlook, so I cant test,

 set _Subject to get the subject of theMessage
  
  set _Sender to sender of theMessage
  set _SenderName to name of _Sender

Thanks! That worked! I really appreciate all the help and suggestions.

Kevin