Outlook meetings and rich text format

ぃ、小莉子 提交于 2019-12-11 16:52:45

问题


I have been working on creating appointments from Powershell in Outlook. Everything seems to be working with the exception of being able to set the appointment.RTFBODY. It looks like it is stored as a byte array, but despite my best efforts and many attempts I have been unable to set it. Any suggestions would be much appreciated. http://pastebin.com/kQvGfNRS

Edit: I was able to find what could be a similar issue. https://social.msdn.microsoft.com/Forums/sqlserver/en-US/5dba0d12-94e8-47a5-b082-93d3693e2a47/cant-set-the-rtfbody-of-an-appointmentitem "I assume you add a wrong version reference. If you add Microsoft.Office.Interop.Outlook 12.0, I could reproduce your issue. I suggest you remove this reference, and add Microsoft.Office.Interop.Outlook 14.0."

Also found this: Outlook AppointmentItem - How do I programmatically add RTF to its Body?


回答1:


from the link in your question - "it is just a known problem in OOM - setting the RtfBody property using early binding works. Setting through IDispatch::GetIDsIfNames / Invoke does not."

Powershell always uses late bindings (i.e. you cannot declare a variable as an instance of a particular object. e.g. AppointmentItem).



来源:https://stackoverflow.com/questions/36086331/outlook-meetings-and-rich-text-format

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!