Solved

Getting Selected Text From Outlook

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
Are you unable to connect or configure Hotmail email account in Microsoft Outlook 2010, 2007? Or Outlook.com emails are not downloading to Outlook? Lets’ see the problem and resolve Outlook Connector error syncing folder hierarchy (0x8004102A).
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 …
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…

863 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

22 Experts available now in Live!

Get 1:1 Help Now