Go Premium for a chance to win a PS4. Enter to Win

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
?
284 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 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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

Changing a few Outlook Options can help keep you organized!
This article will help to fix the below error for MS Exchange server 2010 I. Out Of office not working II. Certificate error "name on the security certificate is invalid or does not match the name of the site" III. Make Internal URLs and External…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
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: …

963 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