I'm trying to take an attachment from an incoming message and attaching it to a journal item.
I've been able to attach the whole message to the journal item, using this syntax:
If Not objAttachment(1) Is Nothing Then
objNewJournalItem.Attachments.Add objAttachment(1), _
olByValue, 1
End If
where objAttachment(1) is a mailitem and objNewJournalItem is the destination journal item (which has text in it already-I'm using it as a template). The attachment gets embedded to the top of the body of the journal item (its format is rich text).
However, when I try to do the same thing, but objAttachment(1) contains a Word document, I get a run-time error:
"The property does not exist. The field you want to modify is not valid for this type of item."
When I hit Help, it tells me it's an automation error:
"An error occurred while executing a method or getting or setting a property of an object variable. The error was reported by the application that created the object."
Any ideas on how to attach the word document to the journal item?
-Christopher
I've been able to attach the whole message to the journal item, using this syntax:
If Not objAttachment(1) Is Nothing Then
objNewJournalItem.Attachments.Add objAttachment(1), _
olByValue, 1
End If
where objAttachment(1) is a mailitem and objNewJournalItem is the destination journal item (which has text in it already-I'm using it as a template). The attachment gets embedded to the top of the body of the journal item (its format is rich text).
However, when I try to do the same thing, but objAttachment(1) contains a Word document, I get a run-time error:
"The property does not exist. The field you want to modify is not valid for this type of item."
When I hit Help, it tells me it's an automation error:
"An error occurred while executing a method or getting or setting a property of an object variable. The error was reported by the application that created the object."
Any ideas on how to attach the word document to the journal item?
-Christopher