Thursday, April 2, 2009

Infopath: Displaying the Outlook email fields

I've been struggling with this for a little while. I found this MSDN article:
http://msdn.microsoft.com/en-us/library/microsoft.office.infopath.mailenvelope(VS.80).aspx

Which stated that I should be able to:
// Set a reference to MailEnvelope object.
MailEnvelope myEnvelope = this.Application.ActiveWindow.MailEnvelope;

But for the life of me the MailEnvelope wasn't there in my Infopath form.

That was until I turned off Browser compatibility:
Uncheck the following setting:
While designing the form > Tools > Form Options > Compatibility > Design a form template that can be opened in a browser or Infopath

After disabling this setting the EmailEnvelope became available and I could open the Email panel and set all the values (To, cc, subject etc).

All I have to figure out now is if I can catch the send event and close Infopath.

No comments:

Post a Comment