Copy Selection in Email Message

K

Keith Norris

Is it possible to select a portion of an existing email and have VBA code
create a new email and make the body of the new email be the selected portion
of the existing email?

Is there a selection property or object I can reference?

If this is possible, can you provide a small sample of code?
 
K

Ken Slovak - [MVP - Outlook]

It depends on the message format and email editor, as well as the object
model you are using.

For the Outlook object model if the item is in WordMail then you can get
ActiveInspector.WordEditor on the item and that is a Word.Document object.
In that case you can use the Word object model to find the selection. That
will fire security prompts however depending on the Outlook version.

If it's HTML and not WordMail you can use ActiveInspector.HTMLEditor which
is an IHTMLDocument object. Then you'd use the IHTMLDocument object model.

Otherwise you'd need to use the Redemption 3rd party library
(www.dimastr.com/redemption) to get at the selection. In that case you'd get
the ActiveInpsector object from Outlook and use CreateObject() on a
SafeInspector object, set the SafeInspector.Item object to
ActiveInspector.MAPIOBJECT and use SafeInspector.SelText to return the
selected text.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top