Solved

Outlook Emails Opening As Editable

Posted on 2009-07-02
6
193 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This process describes the steps required to Import and Export data from and to .pst files using Exchange 2010. We can use these steps to export data from a user to a .pst file, import data back to the same or a different user, or even import data t…
This video shows where to find templates, what they are used for, and how to create and save a custom template using Microsoft Word.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

705 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

20 Experts available now in Live!

Get 1:1 Help Now