Solved

Getting Selected Text From Outlook

Posted on 2009-07-09
4
171 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
  • 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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Join & Write a Comment

Use email signature images to promote corporate certifications and industry awards.
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…
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 …

757 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

13 Experts available now in Live!

Get 1:1 Help Now