Outlook 会议和富文本格式

Outlook meetings and rich text format

我一直致力于通过 Outlook 中的 Powershell 创建约会。除了能够设置 appointment.RTFBODY 之外,一切似乎都正常。它看起来像是存储为一个字节数组,但尽管我尽了最大的努力和多次尝试,我还是无法设置它。任何建议将不胜感激。 http://pastebin.com/kQvGfNRS

编辑:我找到了类似的问题。 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."

还发现了这个:Outlook AppointmentItem - How do I programmatically add RTF to its Body?

来自您问题中的 link - "it is just a known problem in OOM - setting the RtfBody property using early binding works. Setting through IDispatch::GetIDsIfNames / Invoke does not."

Powershell 始终使用后期绑定(即您不能将变量声明为特定对象的实例。例如 AppointmentItem)。