Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2008-10-14
3
Medium Priority
?
282 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 500 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

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

When you have clients or friends from around the world, it becomes a challenge to arrange a meeting or effectively manage your time. This is where Outlook's capability to show 2 time zones in one calendar comes in handy.
This article will help to fix the below errors for MS Exchange Server 2013 I. Certificate error "name on the security certificate is invalid or does not match the name of the site" II. Out of Office not working III. Make Internal URLs and Externa…
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: …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

704 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