Skip to Main Content
HCL Domino Ideas Portal

Welcome to the #dominoforever Product Ideas Forum! The place where you can submit product ideas and enhancement request. We encourage you to participate by voting on, commenting on, and creating new ideas. All new ideas will be evaluated by HCL Product Management & Engineering teams, and the next steps will be communicated. While not all submitted ideas will be executed upon, community feedback will play a key role in influencing which ideas are and when they will be implemented.

For more information and upcoming events around #dominoforever, please visit our Destination Domino Page

Status Under Consideration
Workspace Domino Designer
Categories LotusScript
Created by Guest
Created on Feb 15, 2022

Attaching a file from "EmbedObject" LotusScript code, the attached file is displayed as a generic gray icon

While trying to add attachment using "EmbedObject" lotusscript method, the attachment icon is displaying as grayed out.


However, if you try to add attachment manually, the icon display is proper.

This seems to be working as designed.


Please make the icon display correct (just like it appear while adding manually) using lotusscript method.

Refer to the screenshot attached.

  • Attach files
  • Guest
    Reply
    |
    Feb 15, 2022

    I second this. Would be great to have more options when adding files to richtext items.

    If using Domino JNA (https://github.com/klehmann/domino-jna) is an option for you, you can use


    NotesNote.attachFile(String filePathOnDisk, String uniqueFileNameInNote, Compression compression)

    or

    NotesNote.attachFile(IAttachmentProducer producer, String uniqueFileNameInNote, Date fileCreated, Date fileModified)


    to attach the file to the document. This actually adds the file data to the NSF and creates the $file item pointing to it so that the file is displayed below the document with V2 attachment style.


    Next you can use NotesNote.createRichTextItem(String itemName) to create a new richtext item from scratch (which returns a "RichTextBuilder") and then call one of the RichTextBuilder.addFileHotspot(...) methods to produce the richtext item for the file.


    The most advanced one looks like this:

    NotesNote.addFileHotspot(String attachmentProgrammaticName, String filenameToDisplay, String captionText, FontStyle captionStyle, CaptionPosition captionPos, int captionColorRed, int captionColorGreen, int captionColorBlue, int resizeToWidth, int resizeToHeight, int fileSize, InputStream imageData)


    So you have plenty of options to

    • load the icon from disk or produce it on the fly (even PNG will work)

    • use a custom icon size

    • set a caption text (e.g. the filename, but can be something else as well)

    • change the caption position and color


    Karsten Lehmann, Mindoo GmbH