You must save the message after adding/changing a property (objSource.Save).
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"Martijn Reijm @tdn.nl>" <mreijm<nospam> wrote in message
news:3fe03311$0$38785$(E-Mail Removed)...
> Hi,
>
> I'm building a COM addin for Outlook witch automatically puts a signature
> based on database data at the bottom of every message a users sends.
>
> But when a user replies on a message then that signature should not be
> appended to the body.
>
> I tried the following:
>
> Private Sub mobjReply_Click(ByVal Ctrl As Office.CommandBarButton,
> CancelDefault As Boolean)
> Dim objSource As Outlook.MailItem
> Dim objProp As Outlook.UserProperty
>
> Set objSource = mobjOutlook.ActiveExplorer.Selection.Item(1)
> objSource.UserProperties.Add "Reply", olYesNo
> Set objProp = objSource.UserProperties.Find("Reply")
> objProp.Value = True
>
> End Sub
>
> Here, mobjReply is the "Reply" button in Outlook.
>
> Then I wanted to scan for the Userproperty but I found out that it's gone
> when sending:
>
> Private Sub mobjOutlook_ItemSend(ByVal Item As Object, Cancel As Boolean)
> On Error Resume Next
> Dim objProp As Outlook.UserProperty
> Dim objMailItem As Outlook.MailItem
>
> If Item.Class = olMail Then
> Set objMailItem = Item
>
> Set objProp = objMailItem.UserProperties.Find("Reply")
> If Not objProp Is Nothing Then '<---------------------------------
> It's always Nothing ?!?
> If objProp.Value <> True Then
> 'Voeg de sig toe aan de body van het mailbericht
> Item.Body = Item.Body & vbCrLf & vbCrLf & mstrSig
> End If
> Else
> 'Voeg de sig toe aan de body van het mailbericht
> Item.Body = Item.Body & vbCrLf & vbCrLf & mstrSig
> End If
> End If
> End Sub
>
> Is there a way to determine from the MailItem object wether it is a Relpy
of
> a New message ??
>
> Thanks in advance, Martijn
>
>
>