Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming Forms / June 2009

Tip: Looking for answers? Try searching our database.

how to access current text selection

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DavidH&P - 12 Feb 2007 10:17 GMT
Hi,

I'm using vsto2005SE,
I would like to access to the current text selection of the current MailItem
selection,
How to do that ?

thanks,

David
Ken Slovak - [MVP - Outlook] - 12 Feb 2007 15:09 GMT
If it's plain text or RTF in the Outlook editor you cannot. For HTML you
would get the HTML.Document and use the HTML Document object model. For
WordMail you get the Word.Document and use that object model.

Signature

Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm

> Hi,
>
[quoted text clipped - 7 lines]
>
> David
xiahmi - 29 Jun 2009 18:00 GMT
Hi Ken,

What do you mean?
 "If it's plain text or RTF in the Outlook editor you cannot"
I cannot get the selection?

This is the scenario..

The user selects a part of the mail message/body and I should be able to
copy the selected items and store it as pdf.

Outlook.Selection selection = myActiveExplorer.Selection;

            if (selection is Outlook.MailItem)
           {
               Outlook.MailItem mailItem =
                   (selection as Outlook.MailItem);

                mailItem.Copy();
         
           }

I believe that this would copy the entire mail right?

I only need  to copy the selected objects..
and what would be the possible solution of converting a mail into pdf?

Thanks

> If it's plain text or RTF in the Outlook editor you cannot. For HTML you
> would get the HTML.Document and use the HTML Document object model. For
[quoted text clipped - 11 lines]
> >
> > David
Ken Slovak - [MVP - Outlook] - 30 Jun 2009 13:43 GMT
I think you're confusing two different selections. Outlook.Selection is the
collection of items that are selected. That you can get. As far as getting
what text is selected in a specific email item what I said before goes.
Using the Outlook object model you can't get what text is selected.

If you are using the 3rd party library Redemption
(www.dimastr.com/redemption) you can get the appropriate editor for the type
of item (HTML, plain text, RTF) and that will let you get the selected text.
Otherwise, as I said before, for HTML you would get the HTML.Document and
use the HTML Document object model. For WordMail you get the Word.Document
and use that object model.

Signature

Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm

> Hi Ken,
>
[quoted text clipped - 24 lines]
>
> Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.