Related to this post, I am reading some messages from Exchange and I want the body in plain (non-html) text. I am doing it in F#. Here is the code:
> let exchangeService = new
> ExchangeService(ExchangeVersion.Exchange2007_SP1)
> exchangeService.Credentials <- new
> WebCredentials(userName,password,domain)
> exchangeService.AutodiscoverUrl(email)
>
> let getEmailText exchangeService itemId =
> let propertySet = new PropertySet()
> propertySet.RequestedBodyType <- BodyType.Text
> propertySet.BasePropertySet <- BasePropertySet.FirstClassProperties
> let message = EmailMessage.Bind(exchangeService, itemId, propertySet)
> message.TextBody
The compiler is complaining on this line:
propertySet.RequestedBodyType <- BodyType.Text
This expression was expected to have type Nullable but here has type BodyType
How to I make the BodyType.Text Nullable? Nullable does not work