Hello,
I get the attachment of a document…
Set embed = doc.GetAttachment(“FOTO.jpg”)
But, in this case I know that the name of the attachment is “FOTO.jpg”.
Nut whats happend if I dont know the name of the attachment, how I can know it? or for example how can I get the first Attchment?
Thank you very much!
Subject: Change the name of the ATtACHMENT
You can also use:
Forall i In docMain.Items
If i.type = ATTACHMENT Then
Set embo = docMain.GetAttachment(i.values(0))
Call embo.ExtractFile ("c:\" & embo.name)
End If
End Forall
Throw a check in there for if embo is Nothing and you’re good to go.
Subject: Change the name of the ATtACHMENT
That’s one of those oddities of LS vs. Formula…you’d think that NotesDocument would have an Attachments property, or at least an AttachmentNames property, but you can always set a variant = Evaluate(|@attachmentNames|,doc) to get an array of attachment names to use.
Subject: Change the name of the ATtACHMENT
You can use the .names property
To get: name$ = notesEmbeddedObject.Name
Snippet of Code I use:
Set rtitem = doc.GetFirstItem( “Body” )
If ( rtitem.Type = RICHTEXT ) Then
Forall o In rtitem.EmbeddedObjects
If o.Type = EMBED_ATTACHMENT Then
messagebox o.name
End If
End Forall
End If
Subject: RE: Change the name of the ATtACHMENT
Aye, but that only works if there is a rich text field on the document…