AppointmentItem.body不显示编程文本 [英] AppointmentItem.body not displaying programmed text

查看:53
本文介绍了AppointmentItem.body不显示编程文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我希望能够以编程方式填充AppointmentItem检查器的正文部分,并让用户可以看到它。目前,我想在创建新约会(用于测试)时执行此操作,但稍后将在属性更改时进行预约会议。基本上我想插入文本来构建议程。这就是我在ai_Open事件处理程序中的含义


 private void ai_Open(ref bool Cancel)
{

//这是一个新的会议
ai.MeetingStatus = Microsoft.Office.Interop.Outlook.OlMeetingStatus.olMeeting;
Outlook.Recipient recipient = ai.Recipients.Add(" Marcin Coles");
recipient.Type =(int)Outlook.OlMeetingRecipientType.olRequired;

ai.Body = String.Concat(ai.Body," Description:\ n\\\
\\\
\\\
Agenda:\ n"); //这显然不起作用
ai.Location =" my location" ;;
ai.Subject =" my Subject:" ;;

}


(注意我已删除了检查这是现有会议还是新会议的位...)

基本上身体和收件人都不会显示在检查器表单中(虽然您可以在单击"收件人..."按钮时看到收件人),如果保存/发送而没有用户对主体文本框进行更改,则以编程方式设置正文文本保存在约会项目中。注意,主题&位置显示在检查器表单中,因此在那里不一致。

那么,有没有办法让我执行上述操作 - 即在打开新项目时将内容添加到约会项目中是否在检查员表单文本字段中向用户显示内容?

提前感谢。使用VS2008& Outlook 2003.

解决方案

嗨Marcin Coles!

设置 Body 属性有点奇怪 Outlook.AppointmentItem 不适合您。
您能否向我们展示为变量 ai 指定值的代码?

无论如何,您可以尝试以下方法作为替代方案。
请注意,您需要参考 Microsoft.Office.Interop.Word



使用Word = Microsoft.Office.Interop.Word;
使用Outlook = Microsoft.Office.Interop.Outlook;


用于Outlook.AppointmentItem ai;
Word.Document document =(Word.Document)ai.GetInspector.WordEditor;

document.Content.Text =" Description:\ n\\\
\\\
\ n日程:\\\
英寸;


Hi
I'd like to be able to populate the body section of the AppointmentItem's inspector programmatically and have it visible to the user.  At the moment I want to do this when a new appointment is created (for testing), but later it will be when the property changes that makes an appointment a meeting.  Basically i want to insert text to structure an agenda.  This is what I have in my ai_Open event handler

private void ai_Open(ref bool Cancel)
{
            
    // this is a new meeting       
    ai.MeetingStatus = Microsoft.Office.Interop.Outlook.OlMeetingStatus.olMeeting;
    Outlook.Recipient recipient = ai.Recipients.Add("Marcin Coles");
    recipient.Type = (int)Outlook.OlMeetingRecipientType.olRequired;
   
    ai.Body = String.Concat(ai.Body,"Description:\n\n\n\nAgenda:\n");  //this apparently not working
    ai.Location = "my Location";
    ai.Subject = "my Subject: ";
                
}

(note I have removed the bits that check if this is an existing or new meeting...)

Basically neither the body nor the recipient show up in the inspector form (although you can see the recipient when you click on the To... button) and if save/send with no user-made changes to the body textbox, the programmatically set body text is saved in the appointmentitem.  Note, the subject & location are displayed in the inspector form, so it's not consistent there.

So, is there a way for me to do the above - ie add the content to the appointmentitem when a new one is being opened AND have the content displayed to the user in the inspector form text field?

Thanks in advance.  Using VS2008 & Outlook 2003.

解决方案

Hi Marcin Coles!

It's a bit strange that setting the Body property of the Outlook.AppointmentItem does not work for you.
Can you show us the code wherein you assign a value to the variable ai?

Anyhow, you could try out the following method as an alternative.
Please note that you need a reference to Microsoft.Office.Interop.Word:



using Word = Microsoft.Office.Interop.Word;
using Outlook = Microsoft.Office.Interop.Outlook;


Outlook.AppointmentItem ai;
Word.Document document = (Word.Document)ai.GetInspector.WordEditor;

document.Content.Text = "Description:\n\n\n\n Agenda:\n";


这篇关于AppointmentItem.body不显示编程文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆