Outlook MailItem

I have developed a COM Add-In in C# for a customer, It adds a toolbar and a button to a mailitem, when the user creates a new mail.

I need to get a hold of the cursor location. Based on selections in a dialogbox (winform), the Add-in should insert text at the cursor location in the mail.

Anyone got any ideas VBA is not an option.

Cheers




Answer this question

Outlook MailItem

  • Bonavox

    The closest thing I can think of is is to grab the Body property for the MailItem and append to its contents. This will only work in a sequential fashion. IOW: if the user has finished typing and moves the cursor to a location previously types, things break down.

    If you are using Word as the email editor, things get easier and more interesting. You can use a schema for the text and then add text at the location of certain nodes- a superior technique, for sure.

    It is helpful to remember that this forum is mainly for issues that directly pertain to the Visual Studio Tools for Office tools per se. So you will be best served by posing this question to a forum or newsgroup wholly dedicated to application-specific issues such as yours. Here are links to resources that will help you:

    http://blogs.msdn.com/johnrdurant/archive/2005/12/07/vsto_outlook_resourcelist.aspx

    http://blogs.msdn.com/johnrdurant/archive/2005/12/16/word_developer_resources.aspx

    Take care,



  • tabuelt

    Not really, the post is a little unclear, because I can't use word as an email editor, and it has to work in HTML, RTF and Text formats.

    So I just downloaded redemption from http://www.dimastr.com/redemption/ that and a special markup in the mails was the solution.

    So I guess one could say that Dmitry Streblechenko got the job done ;-)



  • Keiran

    did you find a solution Jesper

    thanks


  • Outlook MailItem