Help!

how to access current text selection

 
  

Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Program Forms RSS
Next:  how to keep form and data send to recipients dire..  
Author Message
DavidH&P
External


Since: Jun 27, 2006
Posts: 8



PostPosted: Mon Feb 12, 2007 2:17 am    Post subject: how to access current text selection
Archived from groups: microsoft>public>outlook>program_forms (more info?)

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
Back to top
Ken Slovak - [MVP - Outlo
External


Since: Oct 17, 2003
Posts: 3355



PostPosted: Mon Feb 12, 2007 10:09 am    Post subject: Re: how to access current text selection [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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.

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


"DavidH&P" <david-mH&P@H&P.com> wrote in message
news:4BC7A7E5-FAEE-498C-9F4E-C73F21B620BE@microsoft.com...
> 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
Back to top
xiahmi
External


Since: Jun 29, 2009
Posts: 1



PostPosted: Mon Jun 29, 2009 10:00 am    Post subject: Re: how to access current text selection [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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

"Ken Slovak - [MVP - Outlook]" wrote:

> 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.
>
> --
> 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
>
>
> "DavidH&P" <david-mH&P@H&P.com> wrote in message
> news:4BC7A7E5-FAEE-498C-9F4E-C73F21B620BE@microsoft.com...
> > 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
>
>
Back to top
Ken Slovak - [MVP - Outlo
External


Since: Oct 17, 2003
Posts: 3355



PostPosted: Tue Jun 30, 2009 8:43 am    Post subject: Re: how to access current text selection [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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.

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


"xiahmi" <xiahmi RemoveThis @discussions.microsoft.com> wrote in message
news:FA507C9C-87D5-4BB6-81CB-1926C2063663@microsoft.com...
> 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
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Program Forms All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum