avenius
Posts: 2
Joined: 2011-12-02
|
Hello Support Team,
I will create an AddIn to add a signature (from file) to each new and reply emails.
I use for this "InspectorActivate" but this event fired two times...
What is the best way for?
Private Sub adxOutlookEvents_InspectorActivate(sender As System.Object, inspector As System.Object, folderName As System.String) Handles adxOutlookEvents.InspectorActivate
Dim mailItem As Outlook.MailItem = TryCast(inspector.CurrentItem, Outlook.MailItem)
Dim strTemplate As String
strTemplate =LoadFile("c:PathSigTemplate.htm")
If Trim(strTemplate) = "" Then
Exit Sub
End If
Dim strBody As String
Dim strOldBody As String = ""
Dim strOldHTMLBody As String = ""
strOldBody = mailItem.Body
strOldHTMLBody = mailItem.HTMLBody
If Not (mailItem Is Nothing) Then
If mailItem.EntryID Is Nothing Then
If mailItem.BodyFormat = Outlook.OlBodyFormat.olFormatPlain Then
mailItem.HTMLBody = strTemplate & "</BR></HR></BR>" & strOldHTMLBody
mailItem.BodyFormat = Outlook.OlBodyFormat.olFormatHTML
ElseIf mailItem.BodyFormat = Outlook.OlBodyFormat.olFormatHTML Then
mailItem.HTMLBody = strTemplate & "</BR></HR></BR>" & strOldHTMLBody
Else
strBody = strOldBody
mailItem.Body = strBody
End If
End If
End If
End Sub
Thanks for help
Best regards
Gunter |
|
Andrei Smolin
Add-in Express team
Posts: 18829
Joined: 2006-05-11
|
|
GunterA
Posts: 2
Joined: 2011-12-02
|
Hello,
I want create this AddIn for Outlook 2003 to Outlook 2010.
I will check the NewInspector event.
Sorry for my bad english.
Thanks and best regards
Gunter |
|
Andrei Smolin
Add-in Express team
Posts: 18829
Joined: 2006-05-11
|
No problem :)
Andrei Smolin
Add-in Express Team Leader |
|