To extract attachment from the NSF file when I check for HASEMBEDDED property it says true
but setting Documents embeded object retuns
nothing.
I looked into different places and found that
these attachments are not part of body of the email and they are called “v2-style”
attachments but can you give me a sample code to extract these types of attachments
programetically?
Subject: Look in Notes FAQ
a href=Lotus Notes/Domino FAQ>Notes FAQ]
Subject: RE: Look in Notes FAQ
Hi,Thank you very much for the reply.
While going through all these froum I found that this attachemnt is V2-Style attachment ( most probaby created using web browser… though not sure…in 6.0 version…I have 5.2 version of notes client)
This attachment is not part of RichText Body but it is outside it …i donno how attached to the document.
When i use the code…
Set rtitem = domShowDocument.GetFirstItem("Body")
If domShowDocument.HasEmbedded Then
If rtitem.Type = RICHTEXT Then
For Each embObj In rtitem.EmbeddedObjects
Here I get error TypeMismatch and get embobj as nothing
next embObj
....
.....
When I look into the lotus client to see how this document looks …it has attachments (which we understand from the value when we get domShowDocument.HasEmbedded = true
but it has different kind of icon and it is definately outside the body part.
When I use
set embobj = domShowDocument.GetFirstItem(“$File”) I do get this object (where embobj is type object in definition)
but I donno How to extract this file because when i get embobj from the BODY part i can use embObj.ExtractFile method on it but when i get this object from GetFirstitem(“$File”) I do not get the method embObj.ExtractFile.
plus with this GetFirstItem(“$File”) if i look for .Values it returns empty objects though it does have attachments.
Subject: RE: Look in Notes FAQ
IBM has Posted This:How to Convert Notes V2/Web-Style Attachment to Attachment Within a Rich Text Field via LotusScript
AT:http://www-1.ibm.com/support/docview.wss?rs=0&uid=swg21104835
Which sujjest following code:
Sub Initialize
Dim doc As NotesDocument
Dim item As Variant
Dim nitem As Variant
Dim rtitem As Variant
Dim uidoc As notesuidocument
Dim w As New notesuiworkspace
Set uidoc=w.currentdocument
Set doc = uidoc.document
Forall i In doc.Items
If i.type = Attachment Then
Set emb = doc.GetAttachment(i.values(0))
{
"I get an error here ( I am using this code in VB) with an error
“Property let procedure not defined and property get procedure did not return an object”
}
Set rtitem=doc.getfirstitem(“RTF”)
Call emb.extractfile("C:" & emb.name)
Call rtitem.embedobject(EMBED_Attachment, “”, "C:" & emb.name, emb.name)
Kill "C:" & emb.name
Call emb.remove
Call doc.save(1,1)
’ If one is only searching for one attachment then remove the remark from the line below
’ Exit Forall
End If
End Forall
End Sub
Can anyone sujjest what I am doing wrong?
Subject: notesDocument.EmbeddedObjects