1
與this相關,我正在閱讀Exchange的一些消息,並希望以純文本格式(非html)顯示正文。我正在使用F#。下面是代碼:EWS body plain text使用F#
> 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
編譯器是抱怨在這條線:
propertySet.RequestedBodyType <- BodyType.Text
這表達預計將有類型可空,但這裏的類型是體形
如何我使BodyType.Text可空?可空不起作用
嘗試'propertySet.RequestedBodyType < - 可空BodyType.Text' –
這就是它- 謝謝! –