Thanks Sue,
The message is not being one-off 'ed because all the fields are present in
the form. However, I've had to code around the fact that the reply may not
be the IPM.NOTE.CP_Message type even though it is set as such. Here is the
code snipet for objMailItem_Reply as coded. You see I change the Message
Class of the Reply. However if I change the code to set the field and not
add it, I get an error.
Private Sub objMailItem_Reply(ByVal Response As Object, Cancel As Boolean)
On Error GoTo Error_Handler
Dim oMail As Outlook.MailItem
Dim oUserProp As UserProperty
Dim strMessageClass As String
If TypeName(Response) = "MailItem" Then
Set oMail = Response
Call WriteLog(TRACE, "clsOutLook->objMailItem->Reply: Response Mail
Item : Subject = " & oMail.Subject & " Message Class = " & oMail.MessageClass)
Call WriteLog(TRACE, "clsOutlook>objMailitem->Reply: Original
Message Class " & objMailItem.MessageClass)
strMessageClass = objMailItem.MessageClass
If LCase(oMail.MessageClass) = "ipm.note" And
(LCase(strMessageClass) = "ipm.note.cp_message" Or LCase(strMessageClass) =
"ipm.note.cp_messageack") Then
Call WriteLog(TRACE, "objMailItem->Reply: Current Mesasge is
CP_message and New Response is IPM.Note")
5 oMail.MessageClass = "IPM.Note.CP_Message" ' Set to CP_Message
6 oMail.UserProperties.Add("IsDirty", olText) = "C"
Dim CurUser As String
CurUser = GetMailboxDisplayName
Dim objADSI As New ADSIFuncs
Set oUserProp = objMailItem.UserProperties.Find("MailNickName")
10 If (TypeName(oUserProp) <> "Nothing") Then
oMail.UserProperties.Add("MailNickName", olText) =
objMailItem.UserProperties.Item("MailNickName").Value
Set oUserProp = objMailItem.UserProperties.Find("CaseSK")
20 If (TypeName(oUserProp) <> "Nothing") Then
oMail.UserProperties.Add("CaseSK", olText) =
objMailItem.UserProperties.Item("CaseSK").Value
Set oUserProp = objMailItem.UserProperties.Find("Matter")
30 If (TypeName(oUserProp) <> "Nothing") Then
oMail.UserProperties.Add("Matter", olText) =
objMailItem.UserProperties.Item("Matter").Value
Set oUserProp = objMailItem.UserProperties.Find("Style")
40 If (TypeName(oUserProp) <> "Nothing") Then
oMail.UserProperties.Add("Style", olText) =
objMailItem.UserProperties.Item("Style").Value
Set oUserProp = objMailItem.UserProperties.Find("DatabaseName")
50 If (TypeName(oUserProp) <> "Nothing") Then
oMail.UserProperties.Add("DatabaseName", olText) =
objMailItem.UserProperties.Item("DatabaseName").Value
Set oUserProp = objMailItem.UserProperties.Find("ProfileName")
60 If (TypeName(oUserProp) <> "Nothing") Then
oMail.UserProperties.Add("ProfileName", olText) =
objMailItem.UserProperties.Item("ProfileName").Value
Set oUserProp = objMailItem.UserProperties.Find("UserSaveAttach")
70 If (TypeName(oUserProp) <> "Nothing") Then
oMail.UserProperties.Add("UserSaveAttach", olNumber) =
objMailItem.UserProperties.Item("UserSaveAttach").Value
Set oUserProp = objMailItem.UserProperties.Find("DocXML")
80 If (TypeName(oUserProp) <> "Nothing") Then
oMail.UserProperties.Add("DocXML", olText) =
objMailItem.UserProperties.Item("DocXML").Value
Set oUserProp = objMailItem.UserProperties.Find("MovedDocs")
90 If (TypeName(oUserProp) <> "Nothing") Then
oMail.UserProperties.Add("MovedDocs", olText) =
objMailItem.UserProperties.Item("MovedDocs").Value
oMail.UserProperties.Add("MessageGUID", olText) = CreateGUID
Set objADSI = Nothing
End If
If (LCase(oMail.MessageClass) = "ipm.note.cp_message" Or
LCase(oMail.MessageClass) = "ipm.note.cp_messageack") Then
oMail.UserProperties.Add("Reply", olText) = "R" ' Tell it is a
reply for Strip Associate Button to Appear objmailitem_open
End If
End If
Set oMail = Nothing
Set oUserProp = Nothing
Call WriteLog(TRACE, "clsOutLook->objMailItem->Reply Complete")
Exit Sub
Error_Handler:
Call fun_ErrorHandler(Err.Number, Err.Source, Err.Description,
"clsOutlook->objMailItem->Reply Erl" & Erl)
Exit Sub
End Sub