Matteo Pasqualin
Posts: 27
Joined: 2006-08-04
|
Hy Sergey,
I'd like to set the Body of the e-mail as Plain Text when the user select a specific option from a combo in my InspectorCommandBar.
The problem is that with the following code, I managed to modify the combo of the current e-mail in wich people can set the type of text, but not the body of the e-mail, moreover the HTML bar remains active even if I modified the combo in Plain Text. Where am I wrong?
Here is my code:
private void adxCmdBarCombo_ifNotify_Change(object sender)
{
if (this.olInsp.CurrentItem is Microsoft.Office.Interop.Outlook.MailItem)
{
Outlook.MailItem _mailItem = null;
if (string.CompareOrdinal(adxCmdBarCombo_ifNotify.Text, "Notify Subject and Body") == 0)
{
try
{
this._olSecurityManager.DisableOOMWarnings = true;
_mailItem = (Outlook.MailItem)this.olInsp.CurrentItem;
MessageBox.Show("E-Mail text will be set to plain text");
_mailItem.BodyFormat = Microsoft.Office.Interop.Outlook.OlBodyFormat.olFormatPlain;
}
catch (Exception ex)
{
...
}
}
...
Thanx
Matteo Pasqualin |
|
Sergey Grischenko
Add-in Express team
Posts: 7235
Joined: 2004-07-05
|
Hi Matteo.
Please try the code below:
.......
_mailItem = (Outlook.MailItem)this.olInsp.CurrentItem;
string body = _mailItem.Body;
_mailItem.BodyFormat = Microsoft.Office.Interop.Outlook.OlBodyFormat.olFormatPlain;
_mailItem.Body = body;
_mailItem.Save();
......
P.S. Note that we take up your forum requests in the order we receive them. Besides, it may take us some time to investigate your issue. Please be sure we will let you know as soon as the best possible solution is found.
|
|
Matteo Pasqualin
Posts: 27
Joined: 2006-08-04
|
Hi Sergey,
great, it works fine!
Matteo |
|