Hab ich mal fürs uidoc gemacht:
Sub setWeblink(strFile$)
Dim ws As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
descrLink$=strLink$
Set uidoc = ws.CurrentDocument
fileNum% = Freefile()
tmpFile$ = Environ$("temp")+"\~tmpFile.htm"
Open tmpFile$ For Output As fileNum%
Print #fileNum%,"<html><a href='" + strFile$ + "'>" + descrLink$ + "</a></html>"
Close fileNum%
If uidoc.CurrentField<>mailField$ Then uidoc.GotoField( mailField$ )
Call uidoc.Import("HTML File",tmpFile$)
End Sub
Aufruf mit
Sub Click(Source As Button)
URL$=Inputbox$("URL:","Internet-Link verknüpfen")
If URL$<>"" Then Call setWebLink(URL$)
End Sub
Edit: die Feldbezeichnung für das RT-Feld, in die der Link importiert werden soll muss natürlich noch als Konstante gesetzt werden oder als Parameter übergeben werden:
Public Const mailField$="Body"
oder
Sub setWeblink(strFile$, mailField$)
Ups, ging ja um Netzwerkdateien:
Sub setFileLink()
Dim ws As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
n$ = String$(1024, " ")
ret% = NEMGetFile( 0, n$,"" , dlgTitle$)
If ret% = 0 Then Exit Sub
strFile$ = Fulltrim(n$)
If Mid$(strFile$,2,1)=":" Then strFile$=Fulltrim(GetUNCPath(Left$(strFile$,2)))+Right$(strFile$,Len(strFile$)-2)
If Left$(strFile$,2)<>"\\" Then Exit Sub
tmpStrFile$=Escape(strFile$)
Set uidoc = ws.CurrentDocument
fileNum% = Freefile()
tmpFile$ = Environ$("temp")+"\~tmpFile.htm"
Open tmpFile$ For Output As fileNum%
Print #fileNum%, |<html><meta http-equiv="content-type" content="text/html" charset="iso-8859-1">
<a href="file:///| +tmpstrFile$ + |" >|+ strFile$ + |</a></html>|
Close fileNum%
If uidoc.CurrentField<>mailField$ Then uidoc.GotoField( mailField$ )
Call uidoc.Import("HTML File",tmpFile$)
End Sub
In den Declarations in diesem Fall:
Declare Function NEMGetFile Lib "NNOTESWS" Alias "NEMGetFile" _
( Z As Integer, Byval N As Lmbcs String, Byval F As Lmbcs String, Byval T As Lmbcs String ) As Integer
Dim UNC As String * 512
Declare Function WNetGetConnection Lib "mpr.dll" Alias _
"WNetGetConnectionA" _
(Byval lpszLocalName As String, _
Byval lpszRemoteName As String, _
cbRemoteName As Long) As Long
Das müsste man dann halt mit obigem zusammenführen...