Programmatic text editing

  • Thread starter Thread starter tedmi
  • Start date Start date
T

tedmi

Is it possible to write a macro to edit the text of a received message? If
so, what part of the object model do I need to explore? In the online
references to Outlook programming, I find lots of info on handling O.L.
items, but not on getting inside an item. Thanks.
 
Sue: Thanks for the response, but those are awfully blunt instruments! Is
there no way operate on selected text, to perform find/replace? I expected
that with the greatly enhanced Word-like capabilities of 2007's native editor
would be exposed in the object model.
 
You didn't mention selected text or Outlook 2007 in your initial post. That changes the scenario considerably. Once you return a Word.Document object from the Inspector.WordEditor method in the Outlook object model, you can use Word methods to work with the Word.Selection object and the rest of the message text. See http://turtleflock-ol2007.spaces.live.com/blog/cns!C1013F1F9A99E3D8!579.entry for an example.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


tedmi said:
Sue: Thanks for the response, but those are awfully blunt instruments! Is
there no way operate on selected text, to perform find/replace? I expected
that with the greatly enhanced Word-like capabilities of 2007's native editor
would be exposed in the object model.
--



Take a look at the MailItem.Body and HTMLBody properties.
 
Back
Top