Re: how to access current text selection

Status
Not open for further replies.
X

xiahmi

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

> >

>

>

>

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


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

"xiahmi" <xiahmi> 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
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
S VBA access current contact? BCM (Business Contact Manager) 1
Victor_50 Problem - Google Workspace will stop "unsafe" access to Outlook end 2024 Using Outlook 3
A Quick Access Toolbar Not Showing Description Using Outlook 0
W Outlook 365 File access denied attempting to import .pst Using Outlook 6
J Recover server side rules from OST/PST without access to the server Using Outlook 2
richardwing Outlook 365 VBA to access "Other Actions" menu for incoming emails in outlook Outlook VBA and Custom Forms 0
V How to add 'Previous Item' and 'Next Item' to the Quick Access Toolbar Using Outlook 1
J Text icon in Quick Access toolbar ? Using Outlook 2
Z Import Tasks from Access Using VBA including User Defined Fields Outlook VBA and Custom Forms 0
klpconsulting Programmatic Access Office 365 Pro Plus & RDS Using Outlook 1
Fozzie Bear Shared Public Folders Access and Use Exchange Server Administration 0
G How to add a folder shortcut to outlook quick access toolbar? Using Outlook 6
D Lost Access to Custom Form Outlook VBA and Custom Forms 4
Jennifer Murphy Grant R/W (update) access to a friend Using Outlook 3
O The page that you are trying to access cannot be loaded. Using Outlook 0
T Render Outlook emails in MS access as they appear in Outlook Outlook VBA and Custom Forms 2
T Outlook "A program is trying to access Outlook" Using Outlook 3
GregS Can't access archive file Using Outlook 5
J What is the best EntryID format to set on MS Access table Outlook VBA and Custom Forms 3
J No access to a Database BCM BCM (Business Contact Manager) 3
R How can I access my emails from corrupt offline files of MS Outlook ? Using Outlook 1
V Change default default save location to Quick Access Using Outlook 1
R Quick Access view in File Explorer when saving attachments Using Outlook 0
D Disable or hide "reply" and "reply to all" and "forward" in email from access vba Outlook VBA and Custom Forms 1
J Open an outlook email by Subject on MS Access linked table with VBA Outlook VBA and Custom Forms 10
G Windows Update Causes BCM Database Access Problem? BCM (Business Contact Manager) 4
D populating listbox on custom form from Access Outlook VBA and Custom Forms 7
O Synchronize safe persons Outlook 2016 -> Outlook Web Access (OWA) Using Outlook 30
K How to access emails found to be located in "Top of Outlook data file"? Using Outlook 3
R Categorize Button in Quick Access Toolbar Disappears on New Email Using Outlook 1
O Outlook Web Access - how to disable spam filter Using Outlook 6
T Lost access to remote BCM database BCM (Business Contact Manager) 4
F Outlook 2016 bulk email from access Outlook VBA and Custom Forms 3
J Programmatic access grayed out Using Outlook 10
Diane Poremsky Synchronize Quick Access Toolbar and Ribbons? Using Outlook 0
G Can't open .pst. Message could not access default folder (Outlook 2010 (.pst). Before that was backi Using Outlook 0
D Creating an outlook session from Access vba but run silently. With A specific profile Outlook VBA and Custom Forms 1
T Cannot access outlook.com accounts in Outlook 2016 Using Outlook 1
B Can't expose sender email address when linking outlook to access Using Outlook 3
Diane Poremsky Change Outlook's Programmatic Access Options Using Outlook 0
S how to access the properties of a contact given distlist.member object Outlook VBA and Custom Forms 1
C OWA External Access - No URL / URL Invalid Exchange Server Administration 2
G Adding a contact to Outlook with a custom form using Access VBA Outlook VBA and Custom Forms 1
C Merging Word and Access into Outlook Using Outlook 4
I Outlook 2016 and Slow access to Outlook.com IMAP Using Outlook 0
B No permission to access Outlook.pst file Using Outlook 1
Norbert VBA Flag that would indicate the email was sent from Outlook to Access. Outlook VBA and Custom Forms 2
M Cannot access the Form Editor BCM (Business Contact Manager) 1
R The changing way to access information in Office 365 Using Outlook 0
M Modifying BCM Database using Access BCM (Business Contact Manager) 1

Similar threads

Back
Top