Inserting a hotspot inside a rich text in using lotusscript
What I need to do is to create a hotspot link and attached it inside a rich text. I already found a way to implement this by following this link:
Now I want the created hotspot to be inside or in the middle of an existing rich text field. If you checked the link it creates a document with a body rich text for the hotspot, I can't identify inserting it inside tried using nav and range but it just gets the plain text, I also want to get the hotspot link. Thanks.
Here is a sample codes (where we append the rich text, but I want to insert it inside - I found a way but it's confusing also using DXL) is there a easy way to solve this:
If rtnav.FindFirstString("<Reply: From>", RT_FIND_CASEINSENSITIVE) Then ' Get the <Reply:From> string Call rtrange.SetBegin(rtnav) Call rtrange.SetEnd(rtnav) ' Remove the <Reply:From> string Call rtrange.Remove() ' Go to the next text range after the <Reply:From> string Call rtrange.SetBegin(rtnav) Call rtrange.SetEnd(rtnav) ' Insert the hotspot in the right place Call rtitem.BeginInsert(rtrange, False) ' ** I WANT TO INSERT HERE THE HOTSPOT, BUT I CAN'T FIGURE IT OUT ** Call rtitem.EndInsert Call rtitem.AppendRTItem(dxlbody) End If
I looked at a very similar problem about five years ago, and I was unable to find a solution. I settled for putting the hotstpot at the beginning instead of in the middle -- i.e., by copying a NotesRichTextItem containing a "prototype" hotspot from an existing configuration document, and inserting that into a new NotesRichText item, then copying the NotesRichTextItem containing the rich text that I'm pre-pending it to.
Note: this could undoubtedly be done using the Midas Rich Text API, but that is a commercial product from Genii Software and I was not in a position where I could use that.
Lotusscript code to append hotspot to a richtext field, My aim is to append a Link hotspot to the rich text field of a notes NotesRichTextItem, using code that has been assigned If there is an error creating the button (often because the code I have a query can we enter the hotspot somewhere inside a rich text meaning not just using/appending "Call rtitem. You can define the insertion point by writing a RT:<SomeFieldName>. Tag the above into the field where the Richtext should be inserted. Known issues: If RT:RTONE is located at the end of the RTItem it has to be terminated by a CRLF. Otherwise the DXLImporter fails.
This is very old and may not work in later versions, but I remember many years ago using an undocumented method to create doclinks.
Call notesRichTextItem.AddLinkByIds( dbReplicaID$, serverHint$, viewUNID$, documentUNID$, comment$ [, HotSpotText$ ])
String. ServerName in Canonical or Common format.
String. UniversalID of the notesview you want to use for opening the document. Use an empty string ("") to create database link if no documentUNID is specified, or to use the default view for opening docLinks.
String. UniversalID of the document you want to link to. Use an empty string ("") to create a view Link or database Link.
String. The text that appears when a user presses and holds the mouse pointer over the link.
Optional. String. If supplied, the HotSpotText will appear in the RichTextItem as boxed text which can be clicked on with the mouse to follow the link. In this case, no other token appears in the text.
AppendDocLink (NotesRichTextItem, If you checked the link it creates a document with a body rich text for the hotspot, I can't identify inserting it inside tried using nav and range but it just gets the For the sake of simplicity, I am appending the current Lotus Notes username, system time and attachments (as selected by the Lotus Notes user) to the rich-text field. The LotusScript code below also allows you to append rich-text item from another Lotus Notes document (commented in the code).
Hi I was able to accomplish my goal by basically applying or using DXL. I manipulated the two rich text DXL thus I was able to insert the hotspot link inside the rich text. Though it requires a lot of codes and it's bit confusing it can be indeed accomplished by that.
Thanks for everyone's help specially to Richard and Ken.
I used this source:
Lotusscript : Can I detect picture in rich text field?, If supplied, the HotSpotText appears in the rich text item as boxed text which can be clicked on with the mouse to follow the doclink. In this case, no other token To delete the placeholder before inserting the replacing content, I use. rtTarget.Delete( &cursor, sizeof( InsertionPoint )); I guess this is what IBM does when you use the FindAndReplace method of the NotesRichTextRange class. But with this metod you can replace text only. Replacing a string with richtext is not supported.
'This works in lotusscript: rs4.PassThruHTML= True Call rtitem.AppendStyle(rs4) rtitem.appendText(|<a href="http://www.teamwork.com.tr">Open</a>|) rs4.PassThruHTML= False Call rtitem.AppendStyle(rs4)
LotusScript: Rich text objects in Notes/Domino 6, Inserting a hotspot inside a rich text in using lotusscript. What I need to do is to create a hotspot link and attached it inside a rich text. I already found a way to NotesRichTextDocLink (LotusScript®) Represents a doclink in a rich text item. NotesRichTextItem (LotusScript®) Represents an item of type rich text. NotesRichTextNavigator (LotusScript®) Represents a means of navigation in a rich text item. NotesRichTextParagraphStyle (LotusScript®) Represents rich text paragraph attributes.
InsertHotspot method, There is no hierarchy of subelements within a rich text field: Navigating table Example 1: Using LotusScript to build a rich text table An insertion is begun at the location in the rich text item pointed to by the navigator, you see information from the doclinks and hotspot links—the database replica ID and A document must be open in Edit mode with the insertion point in a rich text field. This command does not work on the Web. If using this command in a hotspot button or any other element that causes a change in focus, the EditGoToField or EditTop command must be used first to return the focus to the document.
richtext, Inserts a new action hotspot or button before the beginning of a rich text chunk. (Note: If the chunk is defined as Inside, this usually inserts inside the target) As or "Action" or "Action Formula" or "Button using LotusScript for its programming". However, using DXL, you can create a hotspot button dynamically and add it to a rich text field on the fly. In this example, the user selects a number of entries from a database library, and buttons to open up each database are created in a new memo. The code within the buttons is created when a temporary document is processed and imported, each button including the Replica ID for the individual database.
How To Add an Email Signature in Lotus Notes 8.5, When inserting a new row into a table: take current format of the neighbour rows. IdeaSpace: Marking within computed richtext field in edit mode. IdeaSpace: string. Text. The string you want to insert. Usage. A document must be open in Edit mode with the insertion pointin a text or rich text field. or. A form, subform, or page must be open in Design mode. This command does not work on the Web. If using thiscommand in a hotspot button or any other element that causes a changein focus, the EditGoToField or EditTop command must be used firstto return the focus to the document.