Add ins for outlook.

Add-in Express™ Support Service
That's what is more important than anything else

Add ins for outlook.
i am not able to change the body content 
Ranjith Manoharan




Posts: 74
Joined: 2009-06-18
i need a help its very urgent any one please help me as soon as possible.


Private Sub adxOutlookEvents_ExplorerSelectionChange(ByVal sender As Object, ByVal explorer As Object) Handles adxOutlookEvents.ExplorerSelectionChange
itemEvents.ConnectTo(OutlookApp.ActiveExplorer.Selection.Item(1), True)
End Sub

------------------------
Event fires here

Public Overrides Sub ProcessReply(ByVal Response As Object, ByVal E As AddinExpress.MSO.ADXCancelEventArgs)
' TODO: Add some code
Try
'Dim objMail As Microsoft.Office.Interop.Outlook.MailItem
'objMail = Response
'E.Cancel = True
'objMail.BodyFormat = Microsoft.Office.Interop.Outlook.OlBodyFormat.olFormatHTML 'Html Format
'objMail.Display()

Dim unk As IntPtr = Marshal.GetIUnknownForObject(Me.ItemObj)
Me.RemoveConnection()
Dim original As Object = Marshal.GetObjectForIUnknown(unk)
TryCast(original, Outlook._MailItem).Close(Outlook.OlInspectorClose.olDiscard)
Marshal.Release(unk)
Marshal.ReleaseComObject(original)

Dim objMail As Microsoft.Office.Interop.Outlook.MailItem = Response
'MsgBox(objMail.Body)
objMail.Body = objMail.Body + "Testing Reply"
'MsgBox(objMail.Body)
objMail.Subject = objMail.Subject + " Testing Subject"
objMail.BodyFormat = Microsoft.Office.Interop.Outlook.OlBodyFormat.olFormatHTML
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub

This is sample i am using. The body text remains unchage. i am using Vs2008 and outlook 2007.

Please Help Me..

Advance Thanks

Ranjith Manoharan
Thanks & Regards
Ranjith Manoharan
Posted 20 Jun, 2009 12:17:34 Top
Andrei Smolin


Add-in Express team


Posts: 18830
Joined: 2006-05-11
Hello Ranjith,

I've tested catching the Reply event on several systems. First off, I commented out RemoveConnection and all manipulations with the original item.

I believe the description of the Response parameter of the Reply event is misleading because casting Response to Outlook.MailItem and changing MailItem.Body in the Reply event works as follows for me:
- the text of the original Item is changed in Outlook 2003 SP3 and 2007 SP2 (no other Outlook were tested)
- a reply to the changed item is created

So, probably, the best way would be to intercept the NewInspector event. Besides, I tested this in VBA so this isn't a case of an Add-in Express bug.


Andrei Smolin
Add-in Express Team Leader
Posted 22 Jun, 2009 10:03:07 Top