@Carlos has the basic user-level way to do it but it seems you want to do this programattically. I think the most effective approach is to have an action such as "paste link" that:
- accesses the clipboard
- parses the text into a basic html fragment
- saves that fragment to disk
- imports that html into the rich text field
here's an example on how to get to the clipboard.
To import the link into notes, build a rudimentary HTML file from your action, along the lines of:
<html><body>
<a id="myLink" href="http://www.google.com">Google Site</a>
</body></html>
save it and then import it using code like:
dim ws as New NotesUIWorkspace
dim d as NotesUIDocument
set d = ws.currentDocument
call d.import( "HTML File", "c:\foo.html" )
(assuming you saved your file as "c:\foo.html").
Depending on what exactly you are trying to achieve and what you're most comfortable with, you may want to compose the HTML outside of Notes and just have the action do the import bit. If you take this approach then the need to play with the clipboard is gone.
Note the following:
- the method `NotesUIDocument.Import()` injects the contents of the HTML file wherever the cursor is in the rich text (body) field. You need to have your cursor in the right place.
- if you've got the cursor in a non-rich text field you will probably get an error.
- the method `NotesUIDocument.Import()` mirrors the functionality of the menu item `File \ Import` so you don't even have to write any code in Notes if you don't want to.