Inserting a hotspot inside a rich text in using lotusscript

一曲冷凌霜 提交于 2020-01-05 11:30:14

问题


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:

http://ozinisle.blogspot.com/2010/11/lotusscript-code-to-append-hotspot-to.html

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

回答1:


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.




回答2:


This is very old and may not work in later versions, but I remember many years ago using an undocumented method to create doclinks.

Defined In

NotesRichTextItem

Syntax

Call notesRichTextItem.AddLinkByIds( dbReplicaID$, serverHint$, viewUNID$, documentUNID$, comment$ [, HotSpotText$ ])

Parameters

serverHint$

String. ServerName in Canonical or Common format.

viewUNID$

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.

documentUNID$

String. UniversalID of the document you want to link to. Use an empty string ("") to create a view Link or database Link.

comment$

String. The text that appears when a user presses and holds the mouse pointer over the link.

HotSpotText$

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.

Taken from: http://searchdomino.techtarget.com/tip/Creating-DocLinks-using-undocumented-lotusscript-method




回答3:


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:

http://searchdomino.techtarget.com/tip/How-to-insert-RichText-into-RichText-using-LotusScript




回答4:


'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)


来源:https://stackoverflow.com/questions/22803429/inserting-a-hotspot-inside-a-rich-text-in-using-lotusscript

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!