Domino 9 und frühere Versionen > ND7: Entwicklung
Textfeld als Link zum Fileserver
BigWim:
--- Zitat von: Sommerprosse ---Wenn es noch eine einfachere Möglichkeit gibt, wäre ich dankbar, wenn Ihr mir das irgendwie
mitteilt.
--- Ende Zitat ---
Da ich auch kein ausgewiesener Experte bin und vieles mal eben gehen soll, mache ich so:
Einfaches Textfeld (wie gehabt).
Daneben eine Schaltfläche ohne Text (kannst natürlich auch schreiben "Hier klicken" o. ä)
In der Schaltfläche eine Formel (z. B. @Command( [Execute] ....) oder Script zum Öffnen
Markus
Sommersprosse:
Hab jetzt beide Scripte zu einem zusammengefasst und in einen Agenten gepackt, der über den Button gestartet wird.
--- Zitat von: BigWim am 01.09.10 - 10:57:31 ---Da ich auch kein ausgewiesener Experte bin und vieles mal eben gehen soll, mache ich so:
--- Ende Zitat ---
Es funktioniert so wie gefordert, wie es halt manchmal so ist... da geht es mir wie Dir Markus..
--- Code: ---Sub Initialize
Dim uidoc As NotesUIDocument
Dim TempFileName As String
Dim lpIDList As Long ' Declare Varibles
Dim sBuffer As String
Dim szTitle As String
Dim tBrowseInfo As BrowseInfo
Dim db As notesdatabase
Dim docunid As String
Dim item As NotesItem
Dim session As New NotesSession
Dim ws As New notesuiworkspace
Set uidoc = ws.currentDocument
Set doc = uidoc.Document
'Select the file.
szTitle = "Click on a directory path "
' Text to appear in the the gray area under the title bar
' telling you what to do
tBrowseInfo.hWndOwner = 0
tBrowseInfo.lpszTitle = lstrcat(szTitle, "")
tBrowseInfo.ulFlags = 2000
lpIDList = SHBrowseForFolder(tBrowseInfo)
If (lpIDList) Then
sBuffer = Space(MAX_PATH)
SHGetPathFromIDList lpIDList, sBuffer
sBuffer = Left(sBuffer, Instr(sBuffer, Chr(0)) - 1)
filename = Fulltrim(sbuffer)
Call doc.Save(True, True)
End If
'Get the working document.
uidoc.EditMode = True
'Clear the link field.
Call uidoc.FieldSetText( "Link", "" )
'Construct the html code.
Call uidoc.FieldSetText( "HTML", "<html><a href=""file:\\" & filename & """>" & filename & "</a></html>" )
s = uidoc.FieldGetText( "HTML" )
'Write the html code to a temp file.
fileNum% = Freefile()
TempFileName$ = "c:\LinkHotspotCreator.htm"
Open TempFileName$ For Output As fileNum%
Print #fileNum%, s
Close fileNum%
'Import the html file into a rich text field.
uidoc.GotoField( "Link" )
Call uidoc.Import("HTML File",TempFileName$)
'Copy to clipboard.
Call uidoc.GoToField( "Link" )
Call uidoc.SelectAll
Call uidoc.Copy
Messagebox "The informations have been added to the design data", 0 + 64, "Create File Link Hotspot"
'Clean up.
'Kill TempFileName$
'Call uidoc.Close
End Sub
--- Ende Code ---
Sollte das ganze noch einfacher gehen, baue ich auch gerne noch einmal um ;)
Navigation
[0] Themen-Index
[*] Vorherige Sete
Zur normalen Ansicht wechseln