【发布时间】:2012-05-02 02:45:50
【问题描述】:
我正在使用 Outlook 2007,我需要将 RTF 文本插入到 AppointmentItem。我发现一些帖子声称您可以使用这样那样的方式做到这一点,但没有显示如何做到这一点的实际代码。到目前为止我找到的最好的来源是Here
我跟着它,但最后没有任何东西被插入到约会项目中。
以下是我所拥有的:
Word.Document wd = AppointmentItem.GetInspector.WordEditor as Word.Document;
// *Assume that I have all the RTF text that I want to copy set up and ready in the clipboard and is ready to be inserted(copied) into the Appointment Item.
//This doesnt seem to work
wd.Content.Select();
wd.Content.Paste();
//This also doesnt seem to work
(AppointmentItem.GetInspector.WordEditor as Word.Document).Content.Select();
(AppointmentItem.GetInspector.WordEditor as Word.Document).Content.Paste();
因此,根据我所阅读和看到的内容,这就是您假设将 RTF 插入约会项目的方式,但我仍然无法将任何内容放入 AppointmentItem。
现在,如果我看一下这个变量的话:
(AppointmentItem.GetInspector.WordEditor as Word.Document).Content.Text;
但如果我查看AppointmentItem.Text,它仍然没有改变。
现在没有AppointmentItem.paste() 或AppointmentItem.text.paste() 的函数,并且您无权访问约会项目中的RTF 变量。
那么谁能告诉我我错过了什么?如何粘贴到 AppointmentItem 或实际将 RTF 文本放入 AppointmentItem。
谢谢。
【问题讨论】:
标签: com outlook outlook-2007 outlook-2010