?
Solved

Lotusscript - Creating Hotspots

Posted on 2011-10-09
7
Medium Priority
?
1,722 Views
Last Modified: 2013-11-16
I have a RichTextItem on the document to have all links to external files like (Word, Excel, Pdf, etc..). All those documents are stored on a mapped network drive. When user creates a new document, and tries to create a link, I present them with a dialogbox to get the text that should appear and the actual link of the file. How can I create a hotspot link of the file and append it to the RichTextItem field so it can be clickable ?
0
Comment
Question by:Faraj1969
  • 4
  • 3
7 Comments
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 36941896
Your question is almost identical to this one:
http://www.experts-exchange.com/Q_27378330.html
0
 

Author Comment

by:Faraj1969
ID: 36941925
Yes, but almost doesn't count... ;)

What I need exactly, first part, user will click on a button to open directory, user will browse for the file, the file path will be returned as a string array. (this part is done already).

Second part is, via Lotusscript, I need to convert the file path into a hotspot link and insert it into a Rich Text Field. (this is what I'm struggling with).
0
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 2000 total points
ID: 36942016
Ah, right...

Can you add some passthru-HTML to the rich text, with the link? Like
      <A href="yourdoc">link</A>

The property passthruHtml is a property of a NotesRichTextStyle.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:Faraj1969
ID: 36942881
Here's the code I wrote based on your recommendation:
----------------------------------------
Sub Click(Source As Button)
   Dim sesSe As New NotesSession
   Dim uiSpace As New NotesUIWorkspace
   Dim uidDoc As NotesUIDocument
   Dim srcDoc As NotesDocument
   Dim rtfStyle As NotesRichTextStyle
   Dim rtfLinks As NotesRichTextItem
      
   Set uidDoc = uiSpace.CurrentDocument
   Set srcDoc = uidDoc.Document
   Set rtfStyle = sesSe.CreateRichTextStyle
   Set rtfLinks = srcDoc.GetFirstItem("Untitled")

   strLink$ = "<a id='myLink' href='file://" + uidDoc.FieldGetText("Untitled3") + "'>" + _ uidDoc.FieldGetText("Untitled2") + "</a></body></html>"

   rtfStyle.PassThruHTML = True
   Call rtfLinks.AppendStyle(rtfStyle)
   Call rtfLinks.AppendText(strLink$)
   Call srcDoc.Save(True, False)
   Call uidDoc.Reload
End Sub
----------------------------------------

I click the button after I save the document, and the debugger runs nicely without problems, but nothing is happening. the Untitled field is Rich Text, and is set to Store contents as HTML and MIME.

Any idea's ?
0
 

Author Comment

by:Faraj1969
ID: 36943004
For the sake of testing I changed the code to this:
-------------------------------------------------
Sub Click(Source As Button)
   Dim sesSe As New NotesSession
   Dim uiSpace As New NotesUIWorkspace
   Dim uidDoc As NotesUIDocument
   Dim srcDoc As NotesDocument
   Dim rtfStyle As NotesRichTextStyle
   Dim rtfLinks As NotesRichTextItem
      
   Set uidDoc = uiSpace.CurrentDocument
   Set srcDoc = uidDoc.Document
   Set rtfStyle = sesSe.CreateRichTextStyle
   Set rtfLinks = srcDoc.GetFirstItem("Untitled")
      
   strLink$ = "<a id='myLink' href='file://c:\foo.html'>Just a file to open</a>"

   rtfStyle.Bold = True
   rtfStyle.NotesColor = COLOR_GREEN
   rtfStyle.PassThruHTML = True
   rtfStyle.Underline = True

   Call rtfLinks.AppendStyle(rtfStyle)
   Call rtfLinks.AppendText(strLink$)
   Call srcDoc.Save(True, False)
   Call uidDoc.Reload
End Sub
-------------------------------------------------
What am I doing wrong ?
Cheers
0
 

Author Closing Comment

by:Faraj1969
ID: 36944233
I remember the days when I used to get an answer in less than 5 minutes, and I kept my subscription for a long time without using it, just wanted to really support the site. Anyway, this question also is not answered, but I'll accept sjef_bosman answer for the points, and sorry to say that I'll just cancel my membership here.

Wish you all the best.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 36945307
I hope you know that the Experts at EE are just volunteers. There's nothing for us here, no dollars, except maybe some glory plus the satisfaction when we can successfully help someone out.

Anyway, I was mistaken about the passthru-html stuff. Please have a look at the NotesRichTextDocLink class. There's a document in the Help database called "Working with doclinks in LotusScript classes". It seems necessary to create a doclink first, using AppendDocLink, before you can turn it into a hotspot.

Sorry that I had to go shopping in order to have some supper...
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
Integration Management Part 2
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question