Search code examples
lotus-noteslotus-domino

How to show an image from the filesystem in a Notes form?


I want to show an image from the filesystem in a Notes client form. I tried using the Picture object, but even the computed image will only allow pictures from the resources. Changing the resources seems to be impossible without expensive third party libraries. How do I solve that?


Solution

  • You can use «Pass-Thru HTML» feature. You can use <img> tag with your image as src attribute. So, just type <img src=", add Computed Text here and type " />. Select all typed text and make it «Pass-Thru HTML» («Text\Pass-Thru HTML» menu). You will see something like this:

    Pass-Thru HTML

    In Computed Text formula type the name of field which holds your image path and save the form:

    ComputedText

    Now, you can use this form:

    Dim ws As New NotesUIWorkspace
    Dim ses As New NotesSession
    Dim doc As NotesDocument
    
    Set doc = ses.CurrentDatabase.CreateDocument
    doc.Form = "FileSystemImage"
    doc.ImageSource = "file:///C:/Images/Add.png"
    
    ws.EditDocument , doc
    

    Note that your image path must be formated in url format.