I’ve created a mail merge agent that adds attachments to memos. When I add an attachment using the paperclip icon on the toolbar the attachment has an icon but when I add them using LS the icon is grey. Can I get it to show program specific icons?
This is a snipet of the code
There’s an attachment in the stationery template to mark where the attached files should go.
Set boody = docMail.GetFirstItem("Body")
Set rtnavBody = boody.CreateNavigator
Call rtnavBody.FindFirstElement(RTELEM_TYPE_FILEATTACHMENT)
Call boody.BeginInsert(rtnavBody)
Call boody.EmbedObject( EMBED_ATTACHMENT, "", "E:\automating work\email warnings\" & xlsSheet.Cells( counter%, 7).Value, "attachytach" )
Call boody.EmbedObject( EMBED_ATTACHMENT, "", "E:\automating work\email warnings\" & xlsSheet.Cells( counter%, 8).Value, "attachytach2" )
Call boody.EndInsert
Call rtnavBody.FindNthElement(RTELEM_TYPE_FILEATTACHMENT, 3)
Set dummyobject = rtnavBody.GetElement
Call dummyobject.Remove
Please help. I’m new to Lotusscript.
Subject: icons for attachments
The application-specific icon is a UI artifact and is user-specific, since different users, on Windows at least, can define different programs to work with the same file type. Back-end code will not create an attachment-specific icon unless you modify the image data – which means delving into the morass of CD* records using the C API or modifying the document in DXL**.
*Composite Data or Compound Document – both are historically correct
**Domino XML
Subject: icons for attachments
This is fairly complex stuff. If you wanted to do this yourself, you would have a few different tasks to tackle. The first is the control over CD records, as Stan describes. The second is the ability to render the name of the file as part of the graphic, which would require some form of graphics package. The third is the control over the attachment process. The fourth is the ability to either find or pre-store relatively frequently used attachment icons.
If you need it badly, you might want to look at our Midas Rich Text LSX, which will attach the files and put in appropriate file hotspot icons. By appropriate, I mean you can either use fairly standard icons or define your own. See Midas 4.00: More control over file attachments and file icons if you are interested in that level of control, but of course the default is just a relatively normal icon, such as the following:
Of course, Midas is a commercial product and so will cost you something, but depending on the level of need, it may be a relatively painless solution.