如题 private void UStrFormRegion_FormRegionShowing(object sender, System.EventArgs e)
{
_MailItem = this.OutlookItem as Outlook.MailItem;
_PropRefno = _MailItem.UserProperties.Find(PROPERTY_NAME_Refno, Type.Missing);
if (_PropRefno != null)
{
txtRefno.Text = _PropRefno.Value as string;
}
else
{
_PropRefno = _MailItem.UserProperties.Add(PROPERTY_NAME_Refno, Outlook.OlUserPropertyType.olText, true);
txtRefno.Text = "";
}
txtRefno.TextChanged += new EventHandler(UStrMail_Changed);
_MailItem.Write += new Outlook.ItemEvents_10_WriteEventHandler(UStrMail_Write); this.OutlookFormRegion.SetControlItemProperty(txtRefno, PROPERTY_NAME_Refno); //不管用
this.OutlookFormRegion.SuppressControlReplacement = true; //不管用
}
PROPERTY_NAME_Refno 是自定义字段名另外如果要发送自定义字段,注册表项:DisableTNEF 就只能为 0;这样如果对方没有安装我的插件会产生一个 Winmail.dat 的附件,这个问题如何解决!
{
_MailItem = this.OutlookItem as Outlook.MailItem;
_PropRefno = _MailItem.UserProperties.Find(PROPERTY_NAME_Refno, Type.Missing);
if (_PropRefno != null)
{
txtRefno.Text = _PropRefno.Value as string;
}
else
{
_PropRefno = _MailItem.UserProperties.Add(PROPERTY_NAME_Refno, Outlook.OlUserPropertyType.olText, true);
txtRefno.Text = "";
}
txtRefno.TextChanged += new EventHandler(UStrMail_Changed);
_MailItem.Write += new Outlook.ItemEvents_10_WriteEventHandler(UStrMail_Write); this.OutlookFormRegion.SetControlItemProperty(txtRefno, PROPERTY_NAME_Refno); //不管用
this.OutlookFormRegion.SuppressControlReplacement = true; //不管用
}
PROPERTY_NAME_Refno 是自定义字段名另外如果要发送自定义字段,注册表项:DisableTNEF 就只能为 0;这样如果对方没有安装我的插件会产生一个 Winmail.dat 的附件,这个问题如何解决!
因为我发给自己,在邮件列表里加上那个自定义字段能够显示出来,但是打开时却找不到那个字段
_PropRefno = _MailItem.UserProperties.Find(PROPERTY_NAME_Refno, Type.Missing);
即这句如果是收到的邮件就找不到那个自定义的字段。