Solved

Getting Selected Text From Outlook

Posted on 2009-07-09
4
180 Views
Last Modified: 2012-05-07
Is there any was to programatically get at whatever text is currently selected in Outlook?  I tried VBA.SendKeys "^c" as a last resort but even that didn't work.  Any ideas?

Mike
0
Comment
Question by:shacho
[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
  • 2
  • 2
4 Comments
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 24820572
Hello shacho,

Try the following code section .. it works on any mailitem but is defined here to work with the selected text in the open mailitem.

Regards,
Chris
Sub getsel()
Dim itm As Object
Dim insp As Inspector
Dim wd As Object 
    Set itm = Application.ActiveInspector.CurrentItem
    Set insp = itm.GetInspector
    Set wd = insp.WordEditor
    msgbox "Current Selection", wd.Windows(1).Selection
    
End Sub

Open in new window

0
 

Author Comment

by:shacho
ID: 24837806
That might work except I don't use word as my editor and the selected text is in the preview pane, not an open item.  As such there is no active inspector.  Any idea how to get at the preview pane?
0
 
LVL 59

Accepted Solution

by:
Chris Bottomley earned 500 total points
ID: 24838276
In that case, no.

Chris
0
 

Author Comment

by:shacho
ID: 24902541
Oh well.  Thanks for your comments.

Mike
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
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.
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 …

733 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