Solved

How can I add a new custom button only when user opens mail for read purpose?

Posted on 2008-10-14
3
272 Views
Last Modified: 2013-11-08
I have created Outlook add-in using VS .Net 3.5.

In this Add-In I want to add a new custom button only when user opens mail for read purpose. It means when user tries to create New mail or performs any operations like Reply, Reply to all or Forward then I dont want to show this button.

I think I get this done if I check Inspectors EditorType property.

But in case of Outlook  2007 if we double click on any mail in inbox it opens new Inspector and its EditorType is olEditorWord which is same as Inspectors EditorType for New/Reply/ Reply to all/Forward

So how do I know distinguish mail is open for which purpose.  
0
Comment
Question by:aplusexpert
3 Comments
 
LVL 76

Accepted Solution

by:
David Lee earned 125 total points
ID: 22749010
Hi, aplusexpert.

I don't see how checking the Inspector's EditorType property is going to be of any use.  EditorType tells us what editor (i.e. HTML, RTF, plain-text) Outlook is using.  If I open an HTML formatted message EditorType is going to be olEditorHTML without regard to whether I'm reading or editing.  Try this code snippet: http://www.outlookcode.com/codedetail.aspx?id=32

You'll need to modify the function declaration a bit.  Something like this

    Function ShowsComposeLayout(Item As Outlook.MailItem) As Boolean

Pass it an Inspector's CurrentItem and I think you'll be in business.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Resolve Outlook connectivity issues after moving mailbox to new Exchange 2016 server
Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now