Word as Email Editor / Hiding on new mail

Add-in Express™ Support Service
That's what is more important than anything else

Word as Email Editor / Hiding on new mail
Issues/questions regarding sending of new mail 
Richard Stevens


Guest


I've created an Inspector form in Outlook which appears on the right hand side of all email messages when they're opened.

However, I'd like it not to be visble when a user is creating new email messages. I've tried various ways but with no success.

As a related issue, when a new email is created, quite often the message area does not display correctly, it looks like it's not refreshing properly as it contains images/text from elsewhere on the desktop. If I turn off Word as my email editor (Word 2003) it doesn't happen. I can supply a screenshot if required.

Of course if I can solve the first problem the second problem may go away... but it would be nice to have a solution to both?

Richard
Posted 28 Nov, 2006 07:42:14 Top
Fedor Shihantsov


Guest


Hello Richard,

As to new email, use the adxOlFormsManager.ADXNewInspector event in the following way:

procedure TAddInModule.adxOlFormsManager1ADXNewInspector(ASender: TObject;
  Inspector: _Inspector);
var
  mail: MailItem;
  IsNewMail: boolean;
begin
  Inspector.CurrentItem.QueryInterface(IID__MailItem, mail);
  if (mail <> nil) then begin
    adxOlFormsManager1.LockUpdates;//prevent delete cached forms
    try
      IsNewMail := mail.Subject = '';
      if IsNewMail then begin
        adxOlFormsManager1.Items[0].Enabled := false;
      end
      else begin
        adxOlFormsManager1.Items[0].Enabled := true;
      end;
    finally
      adxOlFormsManager1.UnlockUpdates;
    end;
  end;
end;


As to message area refreshing, could you please create a test project with the same behavior and send it to the support email. And the screenshot, please.
Posted 28 Nov, 2006 12:15:59 Top
Richard Stevens


Guest


Thank you. That works very well for new emails. Could I trouble you for something similar that allows me to detect if an email is a reply? And for replies I don't want to disable the form/pane, I just want to tell it to adjust its display slightly so as to be less intrusive. So I imagine the code will need to be on the form itself?

Richard
Posted 29 Nov, 2006 06:44:37 Top
Fedor Shihantsov


Guest


See the LastModificationTime property.
For new emails mail.LastModificationTime = 0.
For reply email subject contains 'RE:' and LastModificationTime is zero.

>So I imagine the code will need to be on the form itself?
You can change the size in the AdxOlForm.ADXBeforeFormShow event.
Posted 29 Nov, 2006 12:45:38 Top
Richard Stevens


Guest


In case anybody else encounters this:

"As a related issue, when a new email is created, quite often the message area does not display correctly, it looks like it's not refreshing properly as it contains images/text from elsewhere on the desktop. If I turn off Word as my email editor (Word 2003) it doesn't happen. "

It looks like it may have been fixed by downloading the Service Pack update to Office 2003 - I'll post again if the problem comes back.

Richard
Posted 03 Dec, 2006 09:00:47 Top