>>Josep Aulina wrote:
>> Does anyone Know how I can attach a file to a richtext using lotusscript ?
>> I try to use the embedObject method defined in NotesRichTextItem, but it
>> return the error: 'Object variable not set'
>> Thank you for advance.
>
>Her's some lines of my code :
>
> Dim body As Notesrichtextitem
> Dim objekt As NotesEmbeddedObject
>........
> Set memo = New NotesDocument(db)
> Set body = New Notesrichtextitem (memo,"Body")
> memo.Form = "Memo"
>.......
> Set objekt = body.EmbedObject( EMBED_ATTACHMENT,
>"",itempath+filename,"Here comes a file")
>Voila, the file is attached !!
>-staale-
This example works only when you want to create a NEW document with a file
attachment.
But how could you do this via a button on the current (open) uidocument ?
i can't find how to access my RTF field
thanks
Yves-eric Martin
>shav...@sn.no, atd...@sefes.es
>thanks
>Yves-eric Martin
This code works with the current document and uidoc.
Attachment :
Dim workspace As New notesuiworkspace
Dim uidoc As notesuidocument
Dim db As NotesDatabase
Dim Doc As NotesDocument
Dim rtitem As notesrichtextitem
Dim soc As Variant
Dim object As notesembeddedobject
Set uidoc=workspace.currentdocument
Set doc = uidoc.document
Set db=doc.parentdatabase
'Set rtitem=doc.getfirstitem("detail_dbfile")
Set rtitem=New notesrichtextitem(doc,"body")
Set object=rtitem.embedobject(EMBED_ATTACHMENT,"",
"c:\malo\devis\devis.db","test")
Detachment :
Dim workspace As New notesuiworkspace
Dim uidoc As notesuidocument
Dim db As NotesDatabase
Dim Doc As NotesDocument
Dim rtitem As Variant
Dim soc As Variant
Dim object As notesembeddedobject
Set uidoc=workspace.currentdocument
Set doc = uidoc.document
Set db=doc.parentdatabase
Set object = doc.GetAttachment( "devis.db" )
'Messagebox(object.name)
Call object.extractfile("c:\malo\devis\temp\test2" )
Call object.remove
Marc JACOB.
Marc JACOB <ja...@iprocess.com> wrote in article
<5c7acl$7...@prof.ese-metz.fr>...
> y...@mail.dotcom.fr (Yves-Eric) wrote:
>
> >shav...@sn.no, atd...@sefes.es
>
> >>>Josep Aulina wrote:
> >>> Does anyone Know how I can attach a file to a richtext using
lotusscript ?
Forgive me for entering a thread that I haven't read from the start, but
does it have to be Lotus Script? I created a button and used the following
formula language:
@Command( [EditUp] );
@Command([EditInsertFileAttachment];Path)
Where @Command([EditUp]); accesses the Rich Text Field directly above my
button in my form and Path is another field containing the full path and
filename of the file to attach.
> >>> I try to use the embedObject method defined in NotesRichTextItem, but
it
> >>> return the error: 'Object variable not set'
> >>> Thank you for advance.
> >>> [rest deleted]
>
> Marc JACOB.
>
Jim Guinn
jlg...@uncc.edu
TIA
Ron Bolzern, Microsoft CP, Lotus CLP
Scone, Scotland