Solved

Outlook Emails Opening As Editable

Posted on 2009-07-02
6
199 Views
Last Modified: 2012-05-07
I'd like a small piece of code which works with Outlook 03 and 07 which will ensure that when I open an email in any folder of my Outlook client (pst) the email open in the usual way but is editable. This should work both for plain text and HTML emails. I'd like to be able to toggle the code off. Can anyone help with this?
0
Comment
Question by:Mike235
  • 3
  • 2
6 Comments
 
LVL 76

Expert Comment

by:David Lee
ID: 24780465
Hi, Mike.

The code below will open the currently selected item for editing.  It should work in both 2003 and 2007, but I've only tested it using 2007.
Sub OpenForEditing()
    Dim olkMessage As Outlook.MailItem, _
        ofcCB As Object, _
        ofcCBB As Object, _
        olkInsp As Outlook.Inspector
    Set olkMessage = Application.ActiveExplorer.Selection(1)
    olkMessage.Display
    Set olkInsp = Application.ActiveInspector
    Set ofcCB = olkInsp.CommandBars("Edit")
    Set ofcCBB = ofcCB.Controls("Edit Message")
    ofcCBB.Execute
    Set ofcCBB = Nothing
    Set ofcCB = Nothing
    Set olkMessage = Nothing
End Sub

Open in new window

0
 

Author Comment

by:Mike235
ID: 24830257
Hi again! This is almost what I need and probably fine. I perhaps wasn't sufficiently clear but what I had hoped for is the following : normal behaviour is that when the 'currently selected item' is highlighted as "Enter" is pressed, then that message item opens read-only. I was hoping for it to open read-write on "Enter". Cheers, Mike
0
 
LVL 76

Accepted Solution

by:
David Lee earned 500 total points
ID: 24830428
Sorry, I don't see any way to do that.  This works by simulating mouse clicks on toolbar selections.  That requires the item to be visible onscreen.  The events that are triggered when an item opens all occur before the item appears onscreen.  The best solution I can offer is to create a toolbar button that runs this code.  You'd click it instead of pressing Enter.
0
 

Author Closing Comment

by:Mike235
ID: 31599151
OK, good enough, and a conclusive answer. Thanks again for the code. Best regards, Mike
0
 
LVL 76

Expert Comment

by:David Lee
ID: 24831299
You're welcome, Mike.
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Microsoft Office Picture Manager is not included in Office 2013. This comes as a shock to users upgrading from earlier versions of Office, such as 2007 and 2010, where Picture Manager was included as a standard application. This article explains how…
Many people use more than one email account and so it becomes difficult for them to manage them when they use separate accounts,  so, in this article, I have shared an easy way to add Other Mail Accounts in your Google Inbox. It helps to combine all…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

679 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