Hi,I have an application that imports emails from Lotus Notes to an external application.
The application uses a button that the user press’s in the Toolbar.
This does various things, for example it gets the sender of the email, the subject, and the body, and any attachments etc, and imports them into the external application.
One user has reported the problem in the Subject line of this post.
I connected with the user’s PC, and we agreed a workaround (forward the emails through notes and then re-import them), but I would like to find out about this error so we can resolve it.
I debugged the code, and this line:
Redim attach(Ubound(body.EmbeddedObjects))
Appears to be giving a ‘type mismatch’ error.
Interestingly, the email did not seem to have ‘attachments’, and therefore this bit of code shouldn’t be running
(see the code below:
If doc.HasEmbedded=False Then Exit Function)
There was no $Attachments field on the email, which had been sent from an external company.
The code works for thousands of other users and for me and even for this user on documents from other external companies, so I speculate there is something different about these particular emails which means that the line gives Type Mismatch - any thoughts?
Here is the whole of that function:
Function getAttachmentList(doc As NotesDocument) As Variant
'This function returns the list of attachments on notes document
Dim body As Variant
Dim UName As Variant
Set body = doc.getFirstItem(“Body”)
If body Is Nothing Then Exit Function
Dim attach() As String
If doc.HasEmbedded=False Then Exit Function
Redim attach(Ubound(body.EmbeddedObjects))
'Calculate number of attachments and total size of attachments
fileCount = 0
Forall attachment In body.EmbeddedObjects
If (attachment.Type = EMBED_ATTACHMENT) Then
attach(FileCount)=attachment.Name
fileCount = fileCount + 1
End If
End Forall
getAttachmentList = attach
End Function
Didn’t see any forum or google results that had this ‘exact’ error…