Home > Ask the Domino Experts > LotusScript Questions & Answers > Creating a rich-text field in Lotus Domino that only accepts doclinks
Ask The Domino Expert: Questions & Answers
EMAIL THIS

Creating a rich-text field in Lotus Domino that only accepts doclinks

Cregg Hardwick EXPERT RESPONSE FROM: Cregg Hardwick

Pose a Question
Other Domino Categories
Meet all Domino Experts
Become an Expert for this site


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


>
QUESTION POSED ON: 01 September 2006

Can we validate a rich-text field in Lotus Domino to only have doclinks?


>

VIEW MEMBER FEEDBACK TO THIS ASK THE EXPERT Q&A.

Not directly, but you can control what gets into the rich-text field to begin with. In Lotus Domino R6 you can create a "Rich Text Light" field that only accepts doclinks. In Lotus Domino R5, you could use a hide-when formula to conceal your rich-text field and provide a button for adding doclinks to it using the LotusScript "AppendDocLink" method of NotesRichTextItem. If the Lotus Notes user has no other way to put anything is the field, it can only contain doclinks.

The trouble with validating what's already in the field is that the only programmatic way to see what's in the field is to call NotesRichTextItem's "GetFormattedText" method. Depending on your situation, this might be sufficient, but it won't let you detect images or other rich-text content.

You might be able to get somewhere by using the DXLExporter to dump the Lotus Notes document to XML and then parse through it for the field in question. If that doesn't work, there's always the Midas Rich Text Toolkit from GenniSoft.

MEMBER FEEDBACK TO THIS ASK THE EXPERT Q&A:

Part of Cregg Hardwick's response was: "In Lotus Domino R6 you can create a 'Rich Text Light' field that only accepts doclinks."

Maybe I'm missing something, but I don't see doclinks as one of the choices in a Rich Text Light field, nor would I equate any of the available choices to being doclinks. Am I missing something?
—Micky R.

******************************************

I was wrong. It is not possible to place a doclink in a "Rich Text Light" field. The rest of my comments are still valid though. The best approach is to control what gets into the field in the first place, by only allowing programmatic updates to the rich-text field. The RichTextItem class has methods for adding any kind of Lotus Notes doclink.

Once you have extant data that you want to validate, however, it gets much harder. I think the best bet is to dump the document in question to XML -- using the DXLexport, and parse the resulting file to find the rich-text field. I have not tried this specifically, but I believe DXL now has full support for rich-text content -- in Lotus Domino R5 it did not. Unfortunately, I don't have time to work through this, and using the DXL functions are non-trivial. So depending on the application, this might or might not be practical.
Cregg Hardwick, LotusScript Expert

Do you have comments on this Ask the Expert Q&A? Let us know.

Related information from SearchDomino.com:

  • Learning Guide: LotusScript development
  • FAQ: LotusScript advice
  • Reference Center: LotusScript tips and resources


  • Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



    RELATED CONTENT
    LotusScript
    LotusScript agent parses ACL to Microsoft Notepad
    LotusScript finds the first occurrence of a string from the right
    Clear Recent Contacts view and prevent repopulation in Lotus Notes 8.x
    Search Microsoft Active Directory with LotusScript
    Three steps to trap and handle save conflicts with LotusScript
    Troubleshoot agents by displaying LotusScript variables online
    LotusScript sorts lists alphabetically
    Run or restart Notes/Domino agents via text messages
    LotusScript code rebuilds corrupted busytime.nsf file
    Soft-code item names to facilitate LotusScript management

    LotusScript
    Can you use LotusScript to read a text file attached to a Notes doc?
    Customize the principal field of outgoing email messages
    Can I use LotusScript to merge cells in a Microsoft Word table?
    Modifying LotusScript code for date and time handling
    Use DXL utilities for advanced replication settings in Notes
    Use LotusScript to create encrypted replicas
    Write a LotusScript agent to automate file attachments
    Troubleshooting a scheduled agent not running on a Global Notes Architecture (GNA) server
    Setting up local replication of a Lotus Notes database for offline employees
    Creating a link on an HTML page to a Microsoft Word attachment in a Lotus Notes database

    RELATED RESOURCES
    2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
    Search Bitpipe.com for the latest white papers and business webcasts
    Whatis.com, the online computer dictionary



    Search and Browse the Expert Answer Center
    Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
    Browse our Expert Advice



    Lotus Notes Domino on Blackberry and mobile devices
    HomeTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
    About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
    SEARCH 
    TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

    TechTarget Corporate Web Site  |  Media Kits  |  Site Map




    All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
      TechTarget - The IT Media ROI Experts