Solved

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

Posted on 2008-10-14
3
279 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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 …

624 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