Type mismatch with simple detach file and send in email

For some reason, I keep getting this annoying Type Mismatch error. If it knows theres a type mismatch, why not just correct it automatically?

heres the code:-

Set rtitem = memo.CreateRichTextItem("Body")

Dim file As Variant

Set file = doc.GetFirstItem( "QuoteAsAttachment" )

Set object = rtitem.EmbedObject _

( EMBED_ATTACHMENT, "", file)



Call memo.Send(False)

The rtitem can be dimmed as either ‘Variant’ or ‘NotesRichTextItem’ - it makes no difference - neither approach works…

All I need is simple, GO TO THE FIELD CALLED ‘QUOTE AS ATTACHMENT’.

TAKE THE FILE THAT IS IN THERE, AND PUT IT IN AN EMAIL…Surely someone has needed to do something like that before?

Subject: Did you actually look at the parameters? It is expecting a file name…

pointing to a file to embed into the body field. You are passing it a NotesItem not a file string.Instead try:

Set rtitem = memo.CreateRichTextItem("Body")

Dim file As NotesRichTextItem

Set file = doc.GetFirstItem( "QuoteAsAttachment" )

Call rtitem.AppendRTItem(file)

Subject: RE: Did you actually look at the parameters? It is expecting a file name…

Thanks very much.