Export Lotus notes data in excel- Lotus Script

Dear Team,

Greetings!

We need lotus script to generate the excel data with attachments name . If attachment fields are multiple so I need the multiples column attachment names. Format should like

Document IdCreated DateCreated ByAttachment1Attachment2Attachment3
FRED11122333123332CCCC2022-01-10Manoj Kumarxx.doctext.xls,text1.docxmd1.docx

Appreciate if you have provide me the solutions.

@Ajeet Gupt If you have work to be done (this and your other posts are not describing a "problem", but a task), perhaps you should offer to pay for it? ;-)

I and a lot of people here are willing to help in our free time, but this is (at least as I understand it) a development task for a company. There are a lot of freelancers and HCL business partners out there, which offer development services.

Hi Thomas,

Thanks for your response.

I am getting the issues while generating the excel reports not how to get the attachment names didn't know about this. Because lotus formula is not supporting to get the attachment names each field wise. That's why I am posting the request on HCL forum. I know about the HCL team continue supporting to the customer.

Appreciate you if you provide me the solutions.

@Ajeet Gupt , just try this:

Column Attachment1 formula:

@if(@iserror(@Attachmentnames[1]);"";@Attachmentnames[1])

Column Attachment2 formula:

@if(@iserror(@Attachmentnames[2]);"";@Attachmentnames[2])

Column Attachment3 formula:

@if(@iserror(@Attachmentnames[3]);"";@Attachmentnames[3])

Not working.

Attachment Field ID: TX_Attachment1, TX_Attachment2,TX_Attachment3

Are you using a view or a LotusScript agent to get the attachments name.

Do you mean you have 3 fields TX_Attachment1, TX_Attachment2 and TX_Attachment3?

And all 3 fields are of type RichText Item?

If LotuScript only

Dim AttatmentNames as variant

dim curdoc as notesdocument ' think you have such code already

AttachmentNames= evaluate({@attachmentnames})

' you then get an array

print AttachmentNames(0) +" first attachment"

print AttachmentNames(1) +" second attachment"

print AttachmentNames(2) +" third attachment"

There are other solutions of course, this is a lazy one

Yes, all attachment fields are rich text.

I am trying to use both side notes view in column and lotus scripts.

Ok so use evaluate("@AttachmentNames")

If you do know your richtext field (attachment1, attachment2, etc....)

Dim rtitem As Variant

Set rtitem = doc.GetFirstItem( “yourfirstrtitem” )
If ( rtitem.Type = RICHTEXT ) Then
Forall o In rtitem.EmbeddedObjects
If ( o.Type = EMBED_ATTACHMENT ) Then
print o.name ’ this is the attachmentname
End If
End Forall
End If

and then do the same for other rtitem

@AttachmentNames can't work in a way needed for this, because it returns the complete list of attachments regardless of the rich-text item, they are stored in. With @AttachmentNames you loose the relation between attachment and item.

Hi Ajeet Gupt,

We request you to please follow the instruction we have given in the word document and try to solve the issue.

Try to execute the code using LotusScript debugger it will help you to understand where the problem is coming.

We have verified in our test environment it executed sucessfully.

Thank you,

Regards,

Sridhar

ExportExcel_Attachments.docx