Domino 9 und frühere Versionen > ND6: Entwicklung
Document link für Dokumente einer anderen DB erzeugen
koehlerbv:
Jana, der einfachste Weg zur Problemlösung wäre, die Herren der Ziel-DB zu veranlassen, dort eine Vorgabeansicht zu definieren.
Alternativ kann ich Dir zwei Methoden nennen, um den DocLink "more individually" zu kreieren. Inwieweit dies bei Dir funktioniert, kann ich nicht beurteilen. Achtung: Methode 1 basiert auf einer undokumentierten Methode der NotesRichTextItem class !
HTH,
Bernhard
Variante 1 - NotesRichTextItem.Add LinkByIDs (UNDOKUMENTIERT !)
--- Zitat ---Given replicaID of a database and the UNIDS of a view or document to link to, adds a link to the end of a rich-text item.
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.
Quelle: Davy Vanherbergen
05 Aug 2002
--- Ende Zitat ---
Variante 2 - Dealing with a NDL file:
--- Zitat ---Sub Click(Source As Button)
'The following piece of code can be pasted in the click event of a button.
'It demonstrates how you can create a database link or a view link using
'LotusScript.
'The e.g. below sends a view link to the People view in the
'local Names & Address book.
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim txtDbName As String, txtServerName As String
Dim txtDbRepID As String
Dim txtViewID As String
Dim txtTempFile As String, txtNotesIDToSendTo As String
Dim rtitem As NotesRichTextItem
Dim note As NotesDocument
On Error Goto EH
'Initialize variables used in the sub
txtServerName = "" 'Local
txtDbName = "names.nsf" 'Db name
'Modify the value of this variable before you use this code
'A sample Notes memo will be sent to this person
txtNotesIDToSendTo = "Siva Ramanathan/Buster/Home Sweet Home"
'Open the database which has the view
Set db = New NotesDatabase(txtServerName,txtDbName)
txtViewName = "People" 'Name of the view in the database
If db.IsOpen Then
Set view = db.GetView(txtViewName)
Else
'Db not found or unable to open
Msgbox "Error opening database " & txtDbName & _
" on server " & txtServerName, 48, "Fatal Error"
Exit Sub
End If
txtDbRepID = db.ReplicaID 'Get the replica id of database
txtViewID = view.UniversalID 'Get the view id of the view
txtTempFile = "\_temp.ndl" 'Temp file
If Not view Is Nothing Then
'Construct the magic code and write to file
Open txtTempFile For Output As #1
Print #1, "Just testing"
Print #1, "<NDL>"
Print #1, "<REPLICA " & Left$(txtDbRepID,8) & ":" & _
Right$(txtDbRepID,8) & ">"
Print #1,"<VIEW " & "OF" & Left$(txtViewID,8) & ":" & _
Mid$(txtViewID,9,8) & "-ON" & Mid$(txtViewID,17,8) & ":" & _
Right$(txtViewID,8) & ">"
Print #1, "<REM>MEOW</REM>"
Print #1, "</NDL>"
Close #1
Else
'View not found!
Msgbox "View " & txtViewName & " not found!", 48, "Fatal Error"
Exit Sub
End If
'Create a sample memo to attach the view link
Set note = New NotesDocument(db)
'Set fields in the memo
note.form = "memo"
note.SendTo = txtNotesIDToSendTo
note.Subject = "I sent you a view link from LotusScript!!"
'Now comes the real thing...
Set rtitem = New NotesRichTextItem(note,"Body")
Call rtitem.AppendText("Double click the attachment and click on " & _
"View (or) Launch ==> ")
'Attach the temp file (which is actually the link)
Call rtitem.EmbedObject(EMBED_ATTACHMENT,"",txtTempFile,"TEST")
'Send the message
Call note.Send(True)
Kill txtTempFile 'Delete the temporary file
Exit Sub
EH:
'Handle other run time
Beep
Msgbox "Error# " & Err & ":" & Error$, 48, "Fatal Error"
Print "Error# " & Err & ":" & Error$
Exit Sub
End Sub
Quelle: Mir unbekannt
--- Ende Zitat ---
js84:
Hi,
also ich danke euch erst mal für eure Hilfe, ich werd mal mit den DB Admins reden. :)
Schönen Abend noch
Navigation
[0] Themen-Index
[*] Vorherige Sete
Zur normalen Ansicht wechseln