Copy Selection in Email Message

  • Thread starter Thread starter Keith Norris
  • Start date Start date
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?
 
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.
 
Back
Top