Load audio file into Media Player control

  • Thread starter Thread starter news.microsoft.com
  • Start date Start date
N

news.microsoft.com

Hello, I've created an Outlook add-in with a Form region that contains
Windows Media player control, all works fine when running it, but my
question is how do I have the media control load the audio file that is
attached to the email when I open the email.

These message have their own message class with the form is associated with,
and they always contain one wave file.

Thanks
Frank
 
Get the Attachments collection of the item in question and iterate each
Attachment member object until you find the wave file. You can check the
Attachment.FileName property to see if the wave file extension is there.
Once you've found the attachment use the Attachment.SaveAsFile method to
save it to the file system, perhaps to a temp file, then call the player to
work with that file. After you are finished you may want to delete the
temporary file.
 
Thank you that did the trick... I was hoping that there would be some
"built-in" function that would allow me to access the file directly... but
the suggestion worked just as good.

Thank you
Frank
 
Back
Top