... to do it by hand:
1. Copy the document as DocLink
2. Open your editor and paste your clipboard
3. Save the file with the extension ".ndl"
4. Attach the file in your document
... to do it with an agent:
Create a button in the document that does:
@Command([EditMakeDocLink]) ;
@Command([ToolsRunMacro]; "SendNDL")
Here is the "SendNDL" Agent:
'[Options]
Option Public
Public Const CF_TEXT = &H001
'[Delcarations]
Declare Function OpenClipboard Lib "User32.dll" Alias "OpenClipboard" (Byval hWnd As Long) As Long
Declare Function GetClipboardData Lib "User32.dll" Alias "GetClipboardData" (Byval wFormat As Integer) As String
Declare Function CloseClipboard Lib "User32.dll" Alias "CloseClipboard" ( ) As Long
'[Initialize]
Sub Initialize
Dim Status As Long
Dim ptr As Long, ghand As Long,handle As Long
Dim Text As String
Dim SendTo As String
Dim s As New notessession
Dim db As NotesDatabase
Dim doc As notesDocument
Dim rtitem As NotesRichTextItem
Set db = s.currentdatabase
Set doc = db.CreateDocument()
' Control of platform 16/32-Bit
If Instr(s.platform,"16") Then
Messagebox ("Wrong Windows-platform; this agent runs only under Windows NT/95")
Exit Sub
End If
' open clipboard
Status = OpenClipboard(handle)
If Status <> 0 Then
' reading clipboard contents
Text = GetClipboardData(CF_TEXT)
Status = CloseClipboard()
Else
Messagebox ("Error opening the clipboard!")
Exit Sub
End If
'Create .ndl file
File = s.GETENVIRONMENTString("Directory",True) &"\link.ndl"
iFileNumber = Freefile
Open File For Output As iFileNumber
Print #iFileNumber, Text
Close #iFileNumber
'Send message
doc.Form = "Memo"
doc.SendTo = "address@email.com"
doc.Subject = "Test NDL"
Set rtitem = doc.CreateRichTextItem("Body")
Call rtitem.EmbedObject ( EMBED_ATTACHMENT, "", File)
doc.send True
Kill File
End Sub
... Thats it => i found it in eknori'es Schatzkiste...
ata